Skip to content

feat: show modifier-only keypresses in visualizer#343

Open
quiet-node wants to merge 1 commit intokeycastr:mainfrom
quiet-node:main
Open

feat: show modifier-only keypresses in visualizer#343
quiet-node wants to merge 1 commit intokeycastr:mainfrom
quiet-node:main

Conversation

@quiet-node
Copy link
Copy Markdown

@quiet-node quiet-node commented Apr 10, 2026

Problem

Pressing a modifier key alone (⌘, ⇧, ⌥, ⌃) showed nothing. Only combos like ⌘E worked.

This is because macOS fires kCGEventFlagsChanged for modifier-only presses instead of kCGEventKeyDown. KeyCastr already captured these events but noteFlagsChanged: was a no-op.

Fix

Implement noteFlagsChanged: to detect newly pressed modifiers and display their glyphs. Respects the existing "Command Keys Only" display mode.

Previously, pressing a modifier key alone (Command, Shift, Option,
Control) produced no output. macOS fires kCGEventFlagsChanged for
these, which was routed to noteFlagsChanged: but implemented as a no-op.

Track previous modifier state and detect newly pressed modifiers on each
flags-changed event. Build a glyph string and append it to the visualizer
window. Respects Command-keys-only display mode.

Signed-off-by: Logan Nguyen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant