Skip to content

feat: typing-safe triggers, a tap-action setting, and a live "Try it" chord tester - #16

Merged
squidllee merged 1 commit into
mainfrom
t3/explore-major-app-improvements
Nov 23, 2026
Merged

squidllee merged 1 commit into
mainfrom
t3/explore-major-app-improvements

Conversation

@squidllee

Copy link
Copy Markdown
Collaborator

Hyperkey turned on its layer the instant any key went down while the trigger was held. If the trigger was a typing key (Space, a letter, punctuation), fast typing rolled over and sent Ctrl+Alt+Shift+ instead of text, so in practice only Caps Lock worked well. A tap could also only replay the trigger: you couldn't make a tap send Escape, and an aborted hold still toggled Caps Lock.

This PR makes three changes:

  • Typing-safe triggers. For typing-key triggers, keys pressed while the trigger is held are buffered until Hyperkey can tell whether you're typing or holding. Typing "space then f" quickly now types normally. A full press of a key while holding, or holding past 200 ms, still gives the chord. Caps Lock, F-keys and other non-typing triggers keep their instant behavior. Your real Shift, Ctrl, Alt and Win keys never change the layer's state.
  • "When tapped" setting: send the trigger key (the old behavior), Escape, or nothing. A trigger held alone for more than 500 ms now sends nothing. Settings files move to schema v3, and v1 and v2 files still load.
  • "Try it" row in settings that shows the last chord the layer produced, for example Ctrl + Alt + Shift + F, so you can confirm it works without leaving the window.

The buffering logic lives in the pure hyperkey-core state machine and is driven by event timestamps. The engine arms a timer on the hook thread for the 200 ms deadline. Buffered keys are replayed with their original virtual-key code, scan code and extended flag.

Proof: clippy with -D warnings and cargo test --workspace pass. All 4 real-hook loopback tests pass (--ignored); 2 are new, covering a typing trigger and the tap action. I also ran the release app with injected input: Caps+F produced the chord and left Caps Lock off, a Space rollover produced no chord, and a Space hold produced the chord.

Caps Lock + F (Try it shows the chord):
chord

Space trigger, Escape tap, rollover typing → no chord:
rollover

Space held + F → chord:
hold

Note: an older Hyperkey build can't read a schema v3 file and falls back to defaults while leaving the file in place, the same way it handles any newer schema.

Reviewed with smol-loop: 1 round with GPT 6 Luna. Minion verdict: approved

Created with Claude Opus 5.5 in Claude Code (T3 Code), with Claude Opus 5.5 workflow subagents and a GPT 6 Luna reviewer.

🤖 Generated with Claude Code

… tester

- Permissive hold for typing-key triggers (Space, letters, digits, ...):
  rollover typing no longer fires Ctrl+Alt+Shift chords.
- Tap action setting (send trigger / Escape / Nothing); a trigger held
  alone for over 500 ms sends nothing. Settings schema v3.
- Real modifiers never change the trigger phase.
- "Try it" row in settings shows the last chord the layer produced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@squidllee
squidllee merged commit 5966c41 into main Nov 23, 2026
2 checks passed
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