
{ "title": "Map ~ + 3 to ctrl+3 in Browsers", "rules": [ { "description": "Map ~ + 3 to ctrl+3 in Specific Browsers", "manipulators": [ { "type": "basic", "from": { "key_code": "3", "modifiers": { "mandatory": ["grave_accent_and_tilde"] } }, "to": [ { "key_code": "3", "modifiers": ["left_control"] } ], "conditions": [ { "type": "frontmost_application_if", "bundle_identifiers": [ "^com\\.google\\.Chrome$", "^com\\.vivaldi\\.Vivaldi$" ] } ] } ] } ] } 上面配置不生效,chatgpt 说不支持。 貌似这个程序也不能实现按 F1 输入 888888 这样的功能
查了下 Hammerspoon 挺强大的,话说 win 下的 autohotkey 好用
感谢@fds, 最终配置
{ "title": "Vivaldi sessionbox Tilde+3 to Ctrl+3", "rules": [ { "description": "Map Tilde+3 to Ctrl+3 in Vivaldi extension sessionbox", "manipulators": [ { "type": "basic", "from": { "simultaneous": [ { "key_code": "grave_accent_and_tilde" }, { "key_code": "3" } ], "simultaneous_options": { "key_down_order": "strict", "to_after_key_up": [ { "set_variable": { "name": "sessionbox_g", "value": 0 } } ] }, "modifiers": { "mandatory": [], "optional": ["any"] } }, "to": [ { "set_variable": { "name": "sessionbox_g", "value": 1 } }, { "key_code": "3", "modifiers": ["left_control"] } ], "conditions": [ { "type": "frontmost_application_if", "bundle_identifiers": [ "^com\\.google\\.Chrome$", "^com\\.vivaldi\\.Vivaldi$" ] } ], "parameters": { "basic.simultaneous_threshold_milliseconds": 500 } } ] } ] } 1 fds 2024 年 2 月 27 日 想实现按住一个常规键,再按另一个常规键,可以参考里面的 Launcher Mode 例子。下面是按 g 和 t 调用 Todoist: ``` { "type": "basic", "from": { "simultaneous": [ { "key_code": "g" }, { "key_code": "t" } ], "simultaneous_options": { "key_down_order": "strict", "key_up_order": "strict_inverse", "to_after_key_up": [ { "set_variable": { "name": "launcher_g", "value": 0 } } ] }, "modifiers": { "mandatory": [], "optional": [ "any" ] } }, "to": [ { "set_variable": { "name": "launcher_g", "value": 1 } }, { "shell_command": "open -a 'Todoist'" } ], "parameters": { "basic.simultaneous_threshold_milliseconds": 500 } }, ``` |