fix(ink): only a bare Alt double press starts the overlay - #105
Merged
Conversation
The Alt state machine armed on every Alt release, whatever that Alt had been doing. An ordinary shortcut (Alt+Tab, Alt+F4) or a held Alt left the machine armed, so the *first* press of the gesture that followed activated the overlay and the second press did nothing — the gesture looked dead even though it had fired and been torn down in between. Port the defences the clips tap machine already has: other key presses poison an attempt, and only a press held for less than the double-click threshold arms it. Also recover from a lost Alt release (session lock, elevated window taking focus) instead of swallowing Alt as auto-repeat forever, and stop an unmatched release — the other Alt key — from cancelling a pending arm. Timestamps now come from the message post time rather than from when the listener got around to the message, so a stalled queue cannot stretch the gap between the two presses past the threshold. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The ink gesture regressed into "sometimes does nothing" because the recognizer armed on any Alt release. Write down the constraints both recognizers now share, plus the UIPI limitation and the message-time rule, so the next global-key feature does not rediscover them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ink/state.rs) armed on every Alt release regardless of what that Alt had been doing, so an ordinary shortcut (Alt+Tab, Alt+F4) or a held Alt would arm it — the gesture's first press then activated and tore down the overlay, and the second press did nothing. Ported the defenses the clips popup (clips/gesture.rs) already has: other keys poison an attempt, only a bare short tap arms, a lost release recovers instead of sticking, and an unmatched release no longer cancels a pending arm.rawkey.rstimestamps now come fromGetMessageTime()(rebased ontoGetTickCount64()) instead of delivery time, so a stalled message queue can't stretch the measured gap between presses..claude/rules/global-keyboard-input.mdfor the next global-key feature.Test plan
cargo test --release— 217 passed (13 new/updated inink::state, one per failure mode)cargo clippy --release --all-targets -- -D warnings— cleancargo fmtnpm run build— typecheck + build clean🤖 Generated with Claude Code