Remove fn as a dictation-key option - #146
Merged
Merged
Conversation
`fn` was the one trigger whose down/up state came from the shared `kCGEventFlagMaskSecondaryFn` bit rather than an `NX_DEVICE*` per-side bit, so it sat outside the invariant the other two options hold: one mask names exactly one physical key. Dropping it leaves right ⌘ and right ⌥, both right-side device bits. No migration code needed: `TriggerKey`'s `rawValue` *is* the persisted keycode and `fromPersisted(_:)` maps anything unrecognized to right ⌘, so an existing `fn` binding decodes to the default rather than an invalid selection. Covered by a regression test alongside the two options removed before it (right ⌃, Caps Lock). The Settings picker iterates `allCases`, so it loses the row with no UI change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Merged
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.
What
Drops
fnfromTriggerKey, leaving right ⌘ (default) and right ⌥ as the dictation triggers.Why
fnwas the one option whose down/up state came from the sharedkCGEventFlagMaskSecondaryFnbit rather than anNX_DEVICE*per-side bit. Every other trigger holds the invariantTriggerKey.deviceModifierMaskwas introduced for — one mask names exactly one physical key, so a release is unambiguous even with the other side held.fnsat outside that family, and its doc comment had to carve out an exception for itself.Migration
None needed, by construction.
TriggerKey'srawValueis the persisted macOS keycode, andfromPersisted(_:)— the single decode-with-default rule shared byTriggerKeyStoreand the@AppStorageviews — maps any unrecognized code to right ⌘. So an existingfnbinding (keycode 63) decodes to the default rather than an invalid selection.removedFunctionFallsBackpins that, alongside the two options removed before it (right ⌃ = 62, Caps Lock = 57).deviceModifierMaskis an exhaustiveswitchwith nodefault:, so removing the case is a compile error at every use site rather than a runtime surprise — which is what makes the removal provably complete.Scope
Sources/BlurtEngine/Hotkey/TriggerKey.swift— case, mask, label, and the doc-comment carve-outTests/BlurtEngineTests/TriggerKeyTests.swift—.functionassertions out, fallback test inREADME.md,AGENTS.md,Sources/BlurtEngine/README.md— trigger listThe Settings picker iterates
TriggerKey.allCases, so it loses the row with no UI edit.DictationKeyTap.flag(for:)just wrapsdeviceModifierMask.SettingsUITests.testHotkeyPickerChangesSelectionexercises right ⌥ and is unaffected.Verification
scripts/check.shgreen locally — 581 tests pass, the ≥88% engine coverage gate holds,peripheryreports no unused declarations left behind, app builds. UI suite and leak scan skipped locally by design; CI covers those.🤖 Generated with Claude Code