fix: let Fn chords pass through during dictation - #1767
Draft
smkwray wants to merge 1 commit into
Draft
Conversation
Owner
|
Thank you for writing this and I do understand the problem and we probably should fix this as well. It will take me some time to review your PR because there are a load of keyboard-related issues right now that I'm slowly poking through, but eventually this probably will be merged in some form |
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.
Problem
On macOS, binding bare Fn as push-to-talk makes Handy consume the modifier. The shortcut path constructs
HotkeyManagerwithnew_with_blocking(), so ordinary chords such as Fn+Delete, Fn+arrows, and Fn+function keys do not reach the focused app while Handy is running.Change
The shortcut manager observes events through
KeyboardListenerand matches registered shortcuts in Handy instead of grabbing them through the blocking manager.For bare-Fn transcription:
Cancellation is serialized through
TranscriptionCoordinatorso a key joining the chord cannot race a still-running start request. The coordinator uses a non-recursive cancellation path rather than sending another cancel command to its own channel.Scope and design question
This is a draft because the observe-without-grab behavior may belong in
handy-keysrather than Handy. I described the adjacent push-to-talk case on handy-computer/handy-keys#10. That issue concerns toggle-mode activation on key-up when a modifier was used alone; this PR does not claim to fix it.The behavior has been tested on Apple Silicon macOS, not Windows or Linux. The current implementation also identifies the two transcription bindings and the literal
fnshortcut explicitly. I would generalize or platform-scope that code based on maintainer direction rather than assume the preferred cross-platform API.Validation
npm run build: passedcargo fmt -- --check: passedcargo clippy --lib: passed with the existing unused-assignment warning insrc/managers/transcription.rs:1178cargo test --lib: 133 passed, 1 failedmossis present in the catalog but absent fromKNOWN_ARCHES; this patch does not touch catalog or model-capability codeThe same patch was built from v0.9.4 and manually exercised on an Apple M1 Ultra. Bare Fn recorded and transcribed, Fn+Delete cancelled while Delete reached the focused app, mouse input did not cancel, the shortcut remained suppressed until Fn release, Escape cancellation worked, and Karabiner/Caps Lock-generated Fn events did not leave Handy stuck.
AI assistance
Codex implemented, rebased, and tested the patch under the contributor's direction. Claude Opus reviewed the scope and PR wording. The contributor manually validated the behavior on macOS.