How nvbangg/keyclipboard works
Main Components
• Keyboard Shortcut Handler: Core component that listens for keyboard events (e.g., CapsLock + S, CapsLock + V) to trigger various clipboard functions.
• User Interface (UI) Module: Comprised of files in the src/UI directory (UI.ahk and clip_UI.ahk), this module manages the popups and settings dialogs.
• Application Logic/Core: Located in src/app (app.ahk, common.ahk, settings.ahk), this layer handles overall application coordination, configuration, and common functionalities.
• Executable Wrapper: Files like KeyClipboard.ahk and KeyClipboard.exe serve as entry points to launch the application.
Relationships and Interactions
• The Keyboard Shortcut Handler triggers events that are received by the Application Logic layer.
• The Application Logic directs operations to the UI module (for displaying settings, clipboard history, or saved items) and to the Clipboard Management module (for performing formatting, saving, or retrieving clipboard data).
• The UI module interacts with the user (displaying dialogs, search results, etc.) and sends user inputs back to the Application Logic.
• Clipboard Management handles direct clipboard interactions, calls formatting routines, and manages the history and storage of clipboard items.
Architectural Patterns & Design Principles
• Layered Architecture: The project cleanly separates concerns into UI, core logic, and clipboard functionalities.
• Event-Driven Architecture: Keyboard shortcuts act as triggers that drive the flow between modules.
• Modularity: Each aspect of the clipboard enhancements (such as formatting, storage, and UI) is split into separate script files, promoting easier maintenance and potential extensibility.
Relevant Technologies, Frameworks, & Components
• AutoHotkey: The primary scripting language used.
• Windows Clipboard: The system integration point that the application replaces/enhances.
• Executable Packaging: KeyClipboard.exe potentially wraps the script for ease of distribution.
• UI Elements: Although simple, the UI is built within AutoHotkey’s capabilities for showing various popups and settings dialogs.
Elements
• Use clear labels for each component (e.g., “Keyboard Shortcut Handler”, “UI Module”, “Application Logic”, “Clipboard Manager”).
• Notes or legends to specify key technologies (AutoHotkey, Windows Clipboard integration) and any configuration aspects such as settings or file-based storage for clipboard history.
Overall Structure Recap
• At the top, have the “Entry Point” labeled by KeyClipboard.ahk / KeyClipboard.exe.
• Beneath that, split the architecture into:
a. A “Keyboard Shortcut/Event Listener” node.
b. An “Application Logic/Core” node — that further routes commands to:
• The “UI Module” (src/UI)
• The “Clipboard Management Module” (src/clipboard)
• External interactions like the system clipboard and user input via the UI.