feat(keybinding): several shortcuts per action, mouse buttons, searchable picker
Shortcuts were defined in four places that drifted apart: per-action IPC channel pairs, a hand-written VK table in the service, a second one in the renderer, and three copies of the keycap styling. Adding an action meant editing all of them, so two shortcuts stayed hardcoded in bootstrap and one had no settings entry at all. packages/core/src/keybinding.ts is now the single source for the binding type, the selectable key catalog, the action catalog, normalization, validation, conflict detection, display labels, search and deserialization. Main, preload and renderer all read from it; nothing redefines keys or rules locally. - Each action holds a list of bindings instead of one. AppConfig's four *Shortcut fields collapse into a single keyBindings map, migrated on launch. - Mouse buttons can be bound. Left click is refused, right/middle need a modifier, side buttons are free. uiohook cannot swallow events, so the original click still fires and the UI says so. - Keys can be picked from a grouped dropdown with a search box, not only by recording a keypress. - HOTKEY's 14 channels become KEYBINDING's 9, taking the action as a parameter, so actions no longer multiply channels. The history and command popups moved out of bootstrap into ordinary actions. - displayLabel is gone; labels derive from the binding and follow the app language and platform. Fixes found on the way: - Double-press hands-free was unreachable: lookup returned only the first matching action, and dictation shares its default binding. - Reserved-combination checks compared joined key names, so a different modifier order let Ctrl+C through. - Disabling shortcuts released every global registration in the process, including the popup ones, and never restored them. - Enabling shortcuts after starting disabled left nothing registered. - The dashboard stored the caption event payload instead of the state in it.
This commit is contained in:
parent
0ca9e242fa
commit
4ad1ae6ed4
49 changed files with 5901 additions and 1792 deletions
|
|
@ -1652,5 +1652,60 @@
|
|||
"mobile.works.section.data": "Data & alerts",
|
||||
"mobile.works.historyDescription": "Search and manage transcripts from recordings and imports.",
|
||||
"mobile.meetings.templateNone": "Start without template",
|
||||
"mobile.meetings.templateNoneDesc": "Pick a template later when generating documents"
|
||||
"mobile.meetings.templateNoneDesc": "Pick a template later when generating documents",
|
||||
"keybinding.mouse.left": "Left Mouse Button",
|
||||
"keybinding.mouse.right": "Right Mouse Button",
|
||||
"keybinding.mouse.middle": "Middle Mouse Button",
|
||||
"keybinding.mouse.back": "Mouse Back Button",
|
||||
"keybinding.mouse.forward": "Mouse Forward Button",
|
||||
"keybinding.group.mouse": "Mouse",
|
||||
"keybinding.group.modifier": "Modifiers",
|
||||
"keybinding.group.function": "Function Keys",
|
||||
"keybinding.group.letter": "Letters",
|
||||
"keybinding.group.digit": "Digits",
|
||||
"keybinding.group.numpad": "Numpad",
|
||||
"keybinding.group.navigation": "Navigation",
|
||||
"keybinding.group.editing": "Editing",
|
||||
"keybinding.group.punctuation": "Punctuation",
|
||||
"keybinding.group.system": "System",
|
||||
"keybinding.action.dictation": "Dictation",
|
||||
"keybinding.action.dictation.desc": "Records while the key is held down.",
|
||||
"keybinding.action.handsFree": "One-Touch Mode",
|
||||
"keybinding.action.handsFree.desc": "Press twice to toggle.",
|
||||
"keybinding.action.command": "Voice Commands",
|
||||
"keybinding.action.command.desc": "Runs a command by voice.",
|
||||
"keybinding.action.caption": "Live Caption",
|
||||
"keybinding.action.caption.desc": "Turns live captions on and off.",
|
||||
"keybinding.action.historyPopup": "History Popup",
|
||||
"keybinding.action.historyPopup.desc": "Opens the history popup.",
|
||||
"keybinding.action.commandPopup": "Command Popup",
|
||||
"keybinding.action.commandPopup.desc": "Opens the command popup.",
|
||||
"keybinding.reject.unknownKey": "This key is not supported",
|
||||
"keybinding.reject.systemReserved": "This is a reserved system shortcut",
|
||||
"keybinding.reject.modifierRequired": "Must be combined with a modifier (Ctrl/Alt/Shift)",
|
||||
"keybinding.disabled.mouseLeft": "Left click is used for every on-screen interaction, so it cannot be bound",
|
||||
"keybinding.warning.mousePassthrough": "Mouse buttons also keep performing their original action",
|
||||
"keybinding.ui.add": "Add",
|
||||
"keybinding.ui.remove": "Remove",
|
||||
"keybinding.ui.reset": "Reset to Default",
|
||||
"keybinding.ui.tabRecord": "Press a Key",
|
||||
"keybinding.ui.tabList": "Choose from List",
|
||||
"keybinding.ui.search": "Search keys",
|
||||
"keybinding.ui.searchEmpty": "No matching keys",
|
||||
"keybinding.ui.pressKeys": "Press the key or mouse button you want",
|
||||
"keybinding.ui.noBindings": "No shortcut set",
|
||||
"keybinding.ui.conflictWith": "Conflicts with {{action}}",
|
||||
"keybinding.ui.modifiers": "Modifiers",
|
||||
"keybinding.ui.selectedKey": "Selected key",
|
||||
"keybinding.ui.sectionVoice": "Voice",
|
||||
"keybinding.ui.sectionWindow": "Windows / Popups",
|
||||
"keybinding.ui.duplicate": "This shortcut has already been added",
|
||||
"keybinding.ui.holdMode": "Hold",
|
||||
"keybinding.ui.doublePress": "Double-press",
|
||||
"keybinding.ui.pickerTitle": "Set Shortcut",
|
||||
"keybinding.ui.pressToRecord": "Press to start recording",
|
||||
"keybinding.ui.recordHint": "Enter a combination (e.g. Ctrl+Shift+Q) or a single key (e.g. F5)",
|
||||
"keybinding.ui.recordAgain": "Clear",
|
||||
"keybinding.ui.saveFailed": "The shortcut could not be saved",
|
||||
"keybinding.ui.globalEnabled": "Enable global shortcuts"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue