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
|
|
@ -270,5 +270,60 @@
|
|||
"mobile.works.historyDescription": "搜索和管理录音与导入的转写记录。",
|
||||
"mobile.meetings.templateEmpty": "没有可用的会议文档模板。可以不使用模板开始会议。",
|
||||
"mobile.meetings.templateNone": "不使用模板开始",
|
||||
"mobile.meetings.templateNoneDesc": "稍后生成文档时再选择模板"
|
||||
"mobile.meetings.templateNoneDesc": "稍后生成文档时再选择模板",
|
||||
"keybinding.mouse.left": "鼠标左键",
|
||||
"keybinding.mouse.right": "鼠标右键",
|
||||
"keybinding.mouse.middle": "鼠标中键",
|
||||
"keybinding.mouse.back": "鼠标后退键",
|
||||
"keybinding.mouse.forward": "鼠标前进键",
|
||||
"keybinding.group.mouse": "鼠标",
|
||||
"keybinding.group.modifier": "修饰键",
|
||||
"keybinding.group.function": "功能键",
|
||||
"keybinding.group.letter": "字母",
|
||||
"keybinding.group.digit": "数字",
|
||||
"keybinding.group.numpad": "小键盘",
|
||||
"keybinding.group.navigation": "导航",
|
||||
"keybinding.group.editing": "编辑",
|
||||
"keybinding.group.punctuation": "符号",
|
||||
"keybinding.group.system": "系统",
|
||||
"keybinding.action.dictation": "听写",
|
||||
"keybinding.action.dictation.desc": "按住期间进行录音。",
|
||||
"keybinding.action.handsFree": "一触即发模式",
|
||||
"keybinding.action.handsFree.desc": "按两下切换开关。",
|
||||
"keybinding.action.command": "语音命令",
|
||||
"keybinding.action.command.desc": "用语音执行命令。",
|
||||
"keybinding.action.caption": "实时字幕",
|
||||
"keybinding.action.caption.desc": "开启或关闭实时字幕。",
|
||||
"keybinding.action.historyPopup": "历史记录弹窗",
|
||||
"keybinding.action.historyPopup.desc": "打开历史记录弹窗。",
|
||||
"keybinding.action.commandPopup": "命令弹窗",
|
||||
"keybinding.action.commandPopup.desc": "打开命令弹窗。",
|
||||
"keybinding.reject.unknownKey": "不支持该按键",
|
||||
"keybinding.reject.systemReserved": "这是系统保留的快捷键",
|
||||
"keybinding.reject.modifierRequired": "必须与修饰键(Ctrl/Alt/Shift)组合使用",
|
||||
"keybinding.disabled.mouseLeft": "左键用于所有界面操作,无法绑定",
|
||||
"keybinding.warning.mousePassthrough": "鼠标按键仍会同时执行其原本的操作",
|
||||
"keybinding.ui.add": "添加",
|
||||
"keybinding.ui.remove": "删除",
|
||||
"keybinding.ui.reset": "恢复默认",
|
||||
"keybinding.ui.tabRecord": "直接输入",
|
||||
"keybinding.ui.tabList": "从列表选择",
|
||||
"keybinding.ui.search": "搜索按键",
|
||||
"keybinding.ui.searchEmpty": "没有搜索结果",
|
||||
"keybinding.ui.pressKeys": "请按下想要使用的按键或鼠标按键",
|
||||
"keybinding.ui.noBindings": "未设置快捷键",
|
||||
"keybinding.ui.conflictWith": "与{{action}}冲突",
|
||||
"keybinding.ui.modifiers": "修饰键",
|
||||
"keybinding.ui.selectedKey": "已选按键",
|
||||
"keybinding.ui.sectionVoice": "语音",
|
||||
"keybinding.ui.sectionWindow": "窗口 / 弹窗",
|
||||
"keybinding.ui.duplicate": "该快捷键已添加",
|
||||
"keybinding.ui.holdMode": "长按",
|
||||
"keybinding.ui.doublePress": "按两下",
|
||||
"keybinding.ui.pickerTitle": "快捷键设置",
|
||||
"keybinding.ui.pressToRecord": "按下开始录音",
|
||||
"keybinding.ui.recordHint": "请输入组合键(例如:Ctrl+Shift+Q)或单个键(例如:F5)",
|
||||
"keybinding.ui.recordAgain": "重新输入",
|
||||
"keybinding.ui.saveFailed": "无法保存快捷键",
|
||||
"keybinding.ui.globalEnabled": "启用全局快捷键"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue