How nigh/i-wanna-clean-keyboard works
Project type and purpose
• This is a small desktop utility written in AutoHotkey (AHK v2).
• Purpose: provide a simple GUI to block/unblock keyboard input when the user is eating, cleaning, or otherwise occupying the keyboard.
File structure
• Top-level files:
• main.ahk – the entry-point script with GUI and event handlers
• meta.ahk – metadata (version, author, build info)
• distribution.ahk – build/packaging script
• .gitmodules + ahk-compile-toolset/ – submodule for compiling AHK to an EXE
• html/index.html + web_gui/ – optional HTML-based GUI assets (if used)
• logo/ – image assets for branding
• Configuration & docs:
• README.md, LICENSE, .gitignore
• Build pipeline:
• distribution.ahk uses the ahk-compile-toolset submodule to produce a standalone executable.
README for additional insights
• Confirms use of AHK v2.0.4, Neutron.ahk for GDI+ graphics, and a dark UI style.
• Specifies user interactions: “Block” toggles keyboard hook, “Exit” unhooks and closes, title bar click & drag.
Components & interactions
a. Main components:
• AHK Runtime (engine provided by Windows)
• Script Modules:
– main.ahk (GUI + event loop)
– meta.ahk (build/config metadata)
• External Libraries:
– Neutron.ahk (GDI+ wrapper)
• UI Layer:
– Buttons (“Block”, “Exit”), draggable title
• System Hook:
– Windows keyboard hook to intercept/block input
• Assets:
– logo images, html GUI (if applicable)
• Packaging Pipeline:
– distribution.ahk + ahk-compile-toolset → EXE
b. Relationships & data flow:
1. User clicks GUI button → main.ahk event handler
2. Handler invokes keyboard hook APIs via Neutron.ahk
3. Keyboard events are either passed through or swallowed
4. UI is updated (button label toggles)
5. distribution.ahk reads meta.ahk & main.ahk → invokes compile toolset → outputs final binary
c. Architectural patterns & design principles:
• Event-driven GUI loop
• Modular scripts (separate build/config metadata)
• Clear separation: UI logic vs. packaging vs. assets
d. Key technologies & libraries:
• AutoHotkey v2
• Neutron.ahk (GDI+ library)
• ahk-compile-toolset (for bundling into EXE)
• Use clear labels: “AHK Engine,” “main.ahk,” “Neutron.ahk,” “Keyboard Hook”
• GUI events → Script Handlers
• Script Handlers → System Hook
• packaging script → compile toolset → output binary
• Green for external libraries
• Orange for system components (keyboard hook, OS APIs)
• Gray for assets (logo, HTML)