Skip to content
← Documentation

Clipboard Engine

Clipboard Engine

The clipboard engine is the core of CyberPaste. It monitors your clipboard, captures rich content, and stores everything in a local SQLite database for instant recall.


Content Types

Text

Plain text clips are stored with full formatting preservation. The engine detects:

  • Single-line and multi-line text
  • Whitespace and indentation
  • Unicode characters and emoji

Code

Code clips are automatically detected and rendered with syntax highlighting:

  • Language auto-detection based on content patterns
  • Syntax highlighting via syntect engine
  • Language badge displayed on clip card
  • Support for 100+ programming languages

HTML

HTML-formatted clipboard content is preserved:

  • Rich text formatting (bold, italic, lists, tables)
  • Hyperlinks preserved
  • Source HTML accessible for editing

RTF

Rich Text Format content from word processors and editors:

  • Formatting preserved (fonts, colors, alignment)
  • Converted to plain text for search indexing
  • Original RTF data retained

Images

Clipboard images are captured and stored:

  • High-resolution preservation
  • PNG and JPEG formats supported
  • OCR text extraction available
  • Full-screen image viewer with zoom

URLs

Web links are automatically detected and categorized:

  • URL detection via pattern matching
  • Domain extraction for display
  • Quick-open in browser action
  • Favicon display on clip card

Files

File paths from copy operations in Explorer:

  • Full path preservation
  • File name and extension display
  • Quick-open containing folder
  • File type icon display

Clipboard Monitoring

Capture Methods

Method Description
Copy (Ctrl+C) Standard clipboard copy detection
Cut (Ctrl+X) Cut operation detection via global keyboard hook
Shift+Delete Alternative cut detection
Manual paste Paste from CyberPaste itself

Duplicate Detection

When the same content is copied consecutively:

  • A duplicate toast notification appears
  • The existing clip's timestamp is refreshed
  • No duplicate entry is created
  • Configurable: show/hide duplicate notifications

Ghost Clip Filtering

Ghost clips are empty or minimal clipboard events:

  • Option to ignore clips with no meaningful content
  • Filters out single-character or whitespace-only clips
  • Configurable via ignore_ghost_clips setting

Smart Monitoring

  • Process-aware: Identifies which application the clip came from
  • Timestamp precision: Millisecond-accurate capture time
  • Content hashing: SHA-256 hash for duplicate detection
  • Size tracking: Tracks content size for storage management

Clip Data Model

Each clip stores:

Field Description
id Unique UUID identifier
content Text content (for search/indexing)
content_type Type classification (text/code/html/rtf/image/url/file)
preview Short preview text for display
source_app Source application name
source_path Source executable path
created_at Capture timestamp
size_bytes Content size in bytes
is_pinned Pin status
is_favorite Favorite status
folder_id Assigned folder (if any)
ocr_text OCR-extracted text (for images)
syntax_language Detected programming language (for code)

Search Indexing

All clips are indexed for instant full-text search:

  • SQLite FTS5 (Full-Text Search) for fast queries
  • Indexes: content, preview, OCR text, source app
  • Real-time results as you type
  • Live counters per content type

Retention and Limits

Storage Limits

Setting Default Description
max_items 300 Maximum number of clips to retain
auto_delete_days 30 Auto-delete clips older than this

Auto-Delete

When limits are reached:

  • Oldest non-pinned clips are deleted first
  • Pinned clips are never auto-deleted
  • Configurable retention period (days or unlimited)

Database

SQLite Configuration

  • Location: %APPDATA%\CyberPaste\cyber_paste.db
  • Mode: WAL (Write-Ahead Logging) for performance
  • Indexes: Optimized for search and filtering
  • Backup: Manual export/import supported

Performance

  • Sub-millisecond search on 10,000+ clips
  • Lazy loading for large content
  • Virtual scrolling for smooth UI