From e2c94e04837830f6891fe766ee72c986112b27a4 Mon Sep 17 00:00:00 2001 From: omonomo Date: Fri, 6 Dec 2024 22:13:26 +0900 Subject: [PATCH] [Update] Second tap on SandS etc. will not input modifier key --- public/json/om_fn_to_esc.json | 63 +++++++- public/json/om_personal_rules.json | 232 ++++++++++++++++++++++++++++- 2 files changed, 291 insertions(+), 4 deletions(-) diff --git a/public/json/om_fn_to_esc.json b/public/json/om_fn_to_esc.json index 47b7535b8..97ecd39ff 100644 --- a/public/json/om_fn_to_esc.json +++ b/public/json/om_fn_to_esc.json @@ -6,17 +6,29 @@ "manipulators": [ { "type": "basic", + "conditions": [ + { + "type": "variable_if", + "name": "fn-esc", + "value": 1 + } + ], "from": { "key_code": "fn", "modifiers": { "optional": [ + "shift", + "option", + "control", + "command", "caps_lock" ] } }, "to": [ { - "key_code": "fn" + "key_code": "fn", + "lazy": true } ], "to_if_alone": [ @@ -24,6 +36,55 @@ "key_code": "escape" } ] + }, + { + "type": "basic", + "from": { + "key_code": "fn", + "modifiers": { + "optional": [ + "shift", + "option", + "control", + "command", + "caps_lock" + ] + } + }, + "to": [ + { + "key_code": "fn" + } + ], + "to_if_alone": [ + { + "key_code": "escape" + }, + { + "set_variable": { + "name": "fn-esc", + "value": 1 + } + } + ], + "to_delayed_action": { + "to_if_invoked": [ + { + "set_variable": { + "name": "fn-esc", + "value": 0 + } + } + ], + "to_if_canceled": [ + { + "set_variable": { + "name": "fn-esc", + "value": 0 + } + } + ] + } } ] } diff --git a/public/json/om_personal_rules.json b/public/json/om_personal_rules.json index 862b9ff22..b9a2f43b1 100644 --- a/public/json/om_personal_rules.json +++ b/public/json/om_personal_rules.json @@ -93,6 +93,13 @@ "manipulators": [ { "type": "basic", + "conditions": [ + { + "type": "variable_if", + "name": "shift-space", + "value": 1 + } + ], "from": { "key_code": "spacebar", "modifiers": { @@ -107,7 +114,8 @@ }, "to": [ { - "key_code": "left_shift" + "key_code": "left_shift", + "lazy": true } ], "to_if_alone": [ @@ -116,6 +124,55 @@ } ] }, + { + "type": "basic", + "from": { + "key_code": "spacebar", + "modifiers": { + "optional": [ + "shift", + "option", + "control", + "command", + "caps_lock" + ] + } + }, + "to": [ + { + "key_code": "left_shift" + } + ], + "to_if_alone": [ + { + "key_code": "spacebar" + }, + { + "set_variable": { + "name": "shift-space", + "value": 1 + } + } + ], + "to_delayed_action": { + "to_if_invoked": [ + { + "set_variable": { + "name": "shift-space", + "value": 0 + } + } + ], + "to_if_canceled": [ + { + "set_variable": { + "name": "shift-space", + "value": 0 + } + } + ] + } + }, { "type": "basic", "from": { @@ -138,6 +195,13 @@ "manipulators": [ { "type": "basic", + "conditions": [ + { + "type": "variable_if", + "name": "control-return", + "value": 1 + } + ], "from": { "key_code": "return_or_enter", "modifiers": { @@ -152,7 +216,8 @@ }, "to": [ { - "key_code": "left_control" + "key_code": "left_control", + "lazy": true } ], "to_if_alone": [ @@ -161,6 +226,55 @@ } ] }, + { + "type": "basic", + "from": { + "key_code": "return_or_enter", + "modifiers": { + "optional": [ + "shift", + "option", + "control", + "command", + "caps_lock" + ] + } + }, + "to": [ + { + "key_code": "left_control" + } + ], + "to_if_alone": [ + { + "key_code": "return_or_enter" + }, + { + "set_variable": { + "name": "control-return", + "value": 1 + } + } + ], + "to_delayed_action": { + "to_if_invoked": [ + { + "set_variable": { + "name": "control-return", + "value": 0 + } + } + ], + "to_if_canceled": [ + { + "set_variable": { + "name": "control-return", + "value": 0 + } + } + ] + } + }, { "type": "basic", "from": { @@ -639,6 +753,38 @@ { "description": "Left_Command alone -> EISUU, Right_Command alone -> KANA", "manipulators": [ + { + "type": "basic", + "conditions": [ + { + "type": "variable_if", + "name": "command-eisuu", + "value": 1 + } + ], + "from": { + "key_code": "left_command", + "modifiers": { + "optional": [ + "shift", + "option", + "control", + "caps_lock" + ] + } + }, + "to": [ + { + "key_code": "left_command", + "lazy": true + } + ], + "to_if_alone": [ + { + "key_code": "japanese_eisuu" + } + ] + }, { "type": "basic", "from": { @@ -660,6 +806,62 @@ "to_if_alone": [ { "key_code": "japanese_eisuu" + }, + { + "set_variable": { + "name": "command-eisuu", + "value": 1 + } + } + ], + "to_delayed_action": { + "to_if_invoked": [ + { + "set_variable": { + "name": "command-eisuu", + "value": 0 + } + } + ], + "to_if_canceled": [ + { + "set_variable": { + "name": "command-eisuu", + "value": 0 + } + } + ] + } + }, + { + "type": "basic", + "conditions": [ + { + "type": "variable_if", + "name": "command-kana", + "value": 1 + } + ], + "from": { + "key_code": "right_command", + "modifiers": { + "optional": [ + "shift", + "option", + "control", + "caps_lock" + ] + } + }, + "to": [ + { + "key_code": "right_command", + "lazy": true + } + ], + "to_if_alone": [ + { + "key_code": "japanese_kana" } ] }, @@ -684,8 +886,32 @@ "to_if_alone": [ { "key_code": "japanese_kana" + }, + { + "set_variable": { + "name": "command-kana", + "value": 1 + } } - ] + ], + "to_delayed_action": { + "to_if_invoked": [ + { + "set_variable": { + "name": "command-kana", + "value": 0 + } + } + ], + "to_if_canceled": [ + { + "set_variable": { + "name": "command-kana", + "value": 0 + } + } + ] + } } ] },