Keybinds: capture the typed key (layout-aware) and warn on conflicts #43
No reviewers
Labels
No labels
breadbug
bug
displays
enhancement
keybinds
network
phase-1
power
privacy
recovery
search
snapshots
sound
ui
ux
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Breadway/bos-settings!43
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/shortcut-capture"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
First half of BSET-32 (the correctness part). The rest of the issue (human action names, grouping, search filter, Advanced disclosure for the raw command) is UI redesign and lands in the
feature/settings-v2PR, which closes BSET-32; this PR deliberately does not use a closing keyword.Capture.
Keybinds.sveltederived letters/digits fromKeyboardEvent.code(the physical QWERTY position) while Hyprland binds by keysym, so on AZERTY the key labelled A (code: KeyQ) was saved as Q. New pure modulefrontend/src/lib/keycapture.ts:event.key: letters upper-cased, digits as is, punctuation as xkb names ([tobracketleft,/toslash, space toSPACE, ...), other characters asUxxxx;!on a US layout) is mapped back to its base key (1) because SHIFT is a modifier of the bind (limit: the reverse table is US pairs; layouts that produce a digit or letter under Shift are handled as that digit or letter);event.key;event.codeis only the fallback for dead keys and generically named media keys.Conflicts.
frontend/src/lib/bindConflicts.ts(findConflict, modifier aliases normalized, the file'sdefault_modsapplied when a bind has nomods, an explicitly emptymodslist kept distinct). The panel holds a captured combo that another live bind already uses (flat: all binds; layouts: globals + common + the bind's layout) and shows "X is already used by Y. Replacing it removes that shortcut." with Replace / Cancel. Replace removes the other bind (nothing is written until Save, as today).Tests.
frontend/src/lib/keycapture.test.mjs(node --experimental-strip-types): AZERTY, Dvorak, Colemak and QWERTY letters, Caps Lock, shifted symbols, punctuation, named keys, dead keys,Uxxxx, bare modifiers, and the conflict rules.Manual test checklist (UI not run, by instruction)
fr), press the key labelled A: recorded as A, not Q.!).Verification:
npm run check(0 errors, 0 warnings),npm run build,node --experimental-strip-types frontend/src/lib/keycapture.test.mjs,cargo fmt --all -- --check,cargo clippy --all-targets --locked -- -D warnings,cargo test --locked(75 passed, unchanged).Refs BSET-32
Closing: these commits reached main through #46 (feature/settings-v2 was merged into the v2 branch).
Pull request closed