From 8c1aede4fd7d2ba21ab85a35ddf0e9deb4879c11 Mon Sep 17 00:00:00 2001 From: Hiroki Ishio Date: Tue, 24 Nov 2026 13:45:11 +0900 Subject: [PATCH 1/5] =?UTF-8?q?Torabo=E3=81=AEZMK=E3=82=AD=E3=83=BC?= =?UTF-8?q?=E3=83=9E=E3=83=83=E3=83=97=E3=81=A8Karabiner=E3=81=AE=E6=A3=B2?= =?UTF-8?q?=E3=81=BF=E5=88=86=E3=81=91=E3=82=92=E6=95=B4=E3=81=88=E3=82=8B?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit F+N/MのIME切替・親指周り・v層と同じ記号配置を本体側に寄せ、Karabiner変換はToraboではF24のキー一覧以外かけないようにする。 Co-authored-by: Cursor --- .../complex_modifications/f_hjkl_arrows.json | 1076 ++++++++++++++-- .config/karabiner/karabiner.json | 1014 ++++++++++++++- .config/karabiner/torabo-tsuki-s.json | 1086 +++++++++++++++-- .config/karabiner/torabo-tsuki-s.md | 2 +- .config/torabo-zmk/README.md | 21 +- .config/torabo-zmk/build-local.sh | 7 +- .config/torabo-zmk/config/torabo_tsuki.conf | 3 + .config/torabo-zmk/config/torabo_tsuki.keymap | 27 +- .github/workflows/torabo-zmk.yml | 1 + tests/karabiner_torabo_shortcut_test.sh | 25 +- tests/torabo_zmk_keymap_test.sh | 12 + 11 files changed, 3030 insertions(+), 244 deletions(-) diff --git a/.config/karabiner/assets/complex_modifications/f_hjkl_arrows.json b/.config/karabiner/assets/complex_modifications/f_hjkl_arrows.json index 4555047..e6d6901 100644 --- a/.config/karabiner/assets/complex_modifications/f_hjkl_arrows.json +++ b/.config/karabiner/assets/complex_modifications/f_hjkl_arrows.json @@ -2,42 +2,42 @@ "title": "f layer + d number pad + v punctuation + 英数/かな/space tap-hold", "rules": [ { - "description": "Torabo-tsuki (S) の f 長押し中に b を押してキー一覧を表示する", - "manipulators": [ - { - "type": "basic", - "from": { - "key_code": "f24", - "modifiers": { - "optional": [ - "any" - ] - } - }, - "conditions": [ - { - "type": "device_if", - "identifiers": [ - { - "vendor_id": 65261, - "product_id": 48301, - "is_keyboard": true - } - ] - } - ], - "to": [ - { - "shell_command": "/bin/bash -lc '$HOME/.bin/karabiner-keymap-hud show'" - } - ], - "to_after_key_up": [ - { - "shell_command": "/bin/bash -lc '$HOME/.bin/karabiner-keymap-hud hide'" - } - ] - } - ] + "description": "Torabo-tsuki (S) の f 長押し中に b を押してキー一覧を表示する", + "manipulators": [ + { + "type": "basic", + "from": { + "key_code": "f24", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "conditions": [ + { + "type": "device_if", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ], + "to": [ + { + "shell_command": "/bin/bash -lc '$HOME/.bin/karabiner-keymap-hud show'" + } + ], + "to_after_key_up": [ + { + "shell_command": "/bin/bash -lc '$HOME/.bin/karabiner-keymap-hud hide'" + } + ] + } + ] }, { "description": "f layer; f+n=ABC f+m=あいう; f+b=HUD; 英数 tap=Enter hold=⌘; f↔英数 either order +a = app switcher; space hold=Shift", @@ -81,11 +81,33 @@ ], "parameters": { "basic.to_if_alone_timeout_milliseconds": 200 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "eisuu_cmd", @@ -131,6 +153,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_cmd_layer", @@ -154,6 +186,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_cmd_layer", @@ -177,6 +219,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_cmd_layer", @@ -200,6 +252,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_cmd_layer", @@ -223,6 +285,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -254,6 +326,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_cmd_layer", @@ -286,6 +368,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_cmd_layer", @@ -340,7 +432,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 500 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -373,7 +477,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 500 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -406,7 +522,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 500 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -439,7 +567,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 500 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -474,6 +614,16 @@ "basic.simultaneous_threshold_milliseconds": 500 }, "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "eisuu_cmd", @@ -507,7 +657,19 @@ ], "parameters": { "basic.to_if_alone_timeout_milliseconds": 200 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -544,7 +706,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -581,7 +755,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -618,7 +804,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -655,7 +853,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -692,11 +902,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -720,6 +952,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -743,6 +985,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -766,6 +1018,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -789,6 +1051,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -844,11 +1116,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -872,6 +1166,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_cmd_layer", @@ -929,7 +1233,19 @@ ], "parameters": { "basic.to_if_alone_timeout_milliseconds": 200 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -966,7 +1282,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -1003,11 +1331,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -1031,6 +1381,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -1054,6 +1414,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -1090,6 +1460,18 @@ }, { "type": "basic", + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ], "from": { "key_code": "japanese_eisuu", "modifiers": { @@ -1121,6 +1503,18 @@ }, { "type": "basic", + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ], "from": { "key_code": "japanese_kana", "modifiers": { @@ -1183,11 +1577,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 350 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -1245,7 +1661,19 @@ ], "parameters": { "basic.to_if_alone_timeout_milliseconds": 200 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -1283,11 +1711,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1344,11 +1794,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1405,11 +1877,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1466,11 +1960,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1527,11 +2043,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1588,11 +2126,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1649,11 +2209,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1710,11 +2292,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1771,11 +2375,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1832,11 +2458,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1889,7 +2537,19 @@ ], "parameters": { "basic.to_if_alone_timeout_milliseconds": 200 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -1927,11 +2587,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -1988,11 +2670,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2049,11 +2753,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2110,11 +2836,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2171,11 +2919,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2232,11 +3002,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2293,11 +3085,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2354,11 +3168,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2415,11 +3251,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2476,11 +3334,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2540,11 +3420,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2604,11 +3506,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", diff --git a/.config/karabiner/karabiner.json b/.config/karabiner/karabiner.json index d9d665f..6eff4b4 100644 --- a/.config/karabiner/karabiner.json +++ b/.config/karabiner/karabiner.json @@ -83,11 +83,33 @@ ], "parameters": { "basic.to_if_alone_timeout_milliseconds": 200 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "eisuu_cmd", @@ -133,6 +155,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_cmd_layer", @@ -156,6 +188,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_cmd_layer", @@ -179,6 +221,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_cmd_layer", @@ -202,6 +254,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_cmd_layer", @@ -225,6 +287,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -256,6 +328,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_cmd_layer", @@ -288,6 +370,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_cmd_layer", @@ -342,7 +434,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 500 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -375,7 +479,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 500 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -408,7 +524,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 500 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -441,7 +569,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 500 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -476,6 +616,16 @@ "basic.simultaneous_threshold_milliseconds": 500 }, "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "eisuu_cmd", @@ -509,7 +659,19 @@ ], "parameters": { "basic.to_if_alone_timeout_milliseconds": 200 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -546,7 +708,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -583,7 +757,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -620,7 +806,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -657,7 +855,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -694,11 +904,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -722,6 +954,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -745,6 +987,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -768,6 +1020,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -791,6 +1053,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -846,11 +1118,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -874,6 +1168,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_cmd_layer", @@ -931,7 +1235,19 @@ ], "parameters": { "basic.to_if_alone_timeout_milliseconds": 200 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -968,7 +1284,19 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -1005,11 +1333,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -1033,6 +1383,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -1056,6 +1416,16 @@ { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -1092,6 +1462,18 @@ }, { "type": "basic", + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ], "from": { "key_code": "japanese_eisuu", "modifiers": { @@ -1123,6 +1505,18 @@ }, { "type": "basic", + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ], "from": { "key_code": "japanese_kana", "modifiers": { @@ -1185,11 +1579,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 350 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "f_held", @@ -1247,7 +1663,19 @@ ], "parameters": { "basic.to_if_alone_timeout_milliseconds": 200 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -1285,11 +1713,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1346,11 +1796,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1407,11 +1879,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1468,11 +1962,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1529,11 +2045,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1590,11 +2128,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1651,11 +2211,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1712,11 +2294,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1773,11 +2377,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1834,11 +2460,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "d_held", @@ -1891,7 +2539,19 @@ ], "parameters": { "basic.to_if_alone_timeout_milliseconds": 200 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", @@ -1929,11 +2589,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -1990,11 +2672,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2051,11 +2755,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2112,11 +2838,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2173,11 +2921,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2234,11 +3004,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2295,11 +3087,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2356,11 +3170,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2417,11 +3253,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2478,11 +3336,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2542,11 +3422,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2606,11 +3508,33 @@ ], "parameters": { "basic.simultaneous_threshold_milliseconds": 250 - } + }, + "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + } + ] }, { "type": "basic", "conditions": [ + { + "type": "device_unless", + "identifiers": [ + { + "vendor_id": 65261, + "product_id": 48301, + "is_keyboard": true + } + ] + }, { "type": "variable_if", "name": "v_held", @@ -2650,8 +3574,14 @@ "selected": true, "simple_modifications": [ { - "from": { "key_code": "international1" }, - "to": [{ "key_code": "hyphen" }] + "from": { + "key_code": "international1" + }, + "to": [ + { + "key_code": "hyphen" + } + ] } ], "virtual_hid_keyboard": { diff --git a/.config/karabiner/torabo-tsuki-s.json b/.config/karabiner/torabo-tsuki-s.json index eb0d945..fbc0ace 100644 --- a/.config/karabiner/torabo-tsuki-s.json +++ b/.config/karabiner/torabo-tsuki-s.json @@ -1,120 +1,984 @@ { "model": "Torabo-tsuki (S)", "note": "各レイヤーのmatrixは実機に保存されている10行×7列の割り当てです。キー番号は0から始まる行と列を示します。座標はVial定義のS配列です。読み取り時の実機オプションはsourceに記録しています。", - "source": {"vial_protocol": 6, "layout_options": 1, "physical_layout": "S"}, + "source": { + "vial_protocol": 6, + "layout_options": 1, + "physical_layout": "S" + }, "keys": [ - {"id": "0,3", "x": 2.0, "y": 0.0}, {"id": "5,3", "x": 11.5, "y": 0.0}, {"id": "0,4", "x": 3.0, "y": 0.13}, - {"id": "5,4", "x": 10.5, "y": 0.13}, {"id": "0,2", "x": 1.0, "y": 0.25}, {"id": "0,5", "x": 4.0, "y": 0.25}, - {"id": "5,5", "x": 9.5, "y": 0.25}, {"id": "5,2", "x": 12.5, "y": 0.25}, {"id": "0,1", "x": 0.0, "y": 0.6}, - {"id": "5,1", "x": 13.5, "y": 0.6}, {"id": "1,3", "x": 2.0, "y": 1.0}, {"id": "6,3", "x": 11.5, "y": 1.0}, - {"id": "1,4", "x": 3.0, "y": 1.13}, {"id": "6,4", "x": 10.5, "y": 1.13}, {"id": "1,2", "x": 1.0, "y": 1.25}, - {"id": "1,5", "x": 4.0, "y": 1.25}, {"id": "6,5", "x": 9.5, "y": 1.25}, {"id": "6,2", "x": 12.5, "y": 1.25}, - {"id": "1,1", "x": 0.0, "y": 1.6}, {"id": "6,1", "x": 13.5, "y": 1.6}, {"id": "2,3", "x": 2.0, "y": 2.0}, - {"id": "7,3", "x": 11.5, "y": 2.0}, {"id": "2,4", "x": 3.0, "y": 2.13}, {"id": "7,4", "x": 10.5, "y": 2.13}, - {"id": "2,2", "x": 1.0, "y": 2.25}, {"id": "2,5", "x": 4.0, "y": 2.25}, {"id": "7,5", "x": 9.5, "y": 2.25}, - {"id": "7,2", "x": 12.5, "y": 2.25}, {"id": "2,1", "x": 0.0, "y": 2.6}, {"id": "7,1", "x": 13.5, "y": 2.6}, - {"id": "4,3", "x": 2.0, "y": 3.0}, {"id": "9,3", "x": 11.5, "y": 3.0}, {"id": "4,2", "x": 1.0, "y": 3.25}, - {"id": "9,2", "x": 12.5, "y": 3.25}, {"id": "4,4", "x": 3.15, "y": 3.5}, {"id": "9,4", "x": 10.35, "y": 3.5}, - {"id": "4,1", "x": 0.0, "y": 3.6}, {"id": "9,1", "x": 13.5, "y": 3.6}, {"id": "4,5", "x": 4.279, "y": 3.594}, - {"id": "4,6", "x": 5.359, "y": 3.9}, {"id": "9,6", "x": 8.14, "y": 3.908}, {"id": "9,5", "x": 9.224, "y": 3.614} + { + "id": "0,3", + "x": 2.0, + "y": 0.0 + }, + { + "id": "5,3", + "x": 11.5, + "y": 0.0 + }, + { + "id": "0,4", + "x": 3.0, + "y": 0.13 + }, + { + "id": "5,4", + "x": 10.5, + "y": 0.13 + }, + { + "id": "0,2", + "x": 1.0, + "y": 0.25 + }, + { + "id": "0,5", + "x": 4.0, + "y": 0.25 + }, + { + "id": "5,5", + "x": 9.5, + "y": 0.25 + }, + { + "id": "5,2", + "x": 12.5, + "y": 0.25 + }, + { + "id": "0,1", + "x": 0.0, + "y": 0.6 + }, + { + "id": "5,1", + "x": 13.5, + "y": 0.6 + }, + { + "id": "1,3", + "x": 2.0, + "y": 1.0 + }, + { + "id": "6,3", + "x": 11.5, + "y": 1.0 + }, + { + "id": "1,4", + "x": 3.0, + "y": 1.13 + }, + { + "id": "6,4", + "x": 10.5, + "y": 1.13 + }, + { + "id": "1,2", + "x": 1.0, + "y": 1.25 + }, + { + "id": "1,5", + "x": 4.0, + "y": 1.25 + }, + { + "id": "6,5", + "x": 9.5, + "y": 1.25 + }, + { + "id": "6,2", + "x": 12.5, + "y": 1.25 + }, + { + "id": "1,1", + "x": 0.0, + "y": 1.6 + }, + { + "id": "6,1", + "x": 13.5, + "y": 1.6 + }, + { + "id": "2,3", + "x": 2.0, + "y": 2.0 + }, + { + "id": "7,3", + "x": 11.5, + "y": 2.0 + }, + { + "id": "2,4", + "x": 3.0, + "y": 2.13 + }, + { + "id": "7,4", + "x": 10.5, + "y": 2.13 + }, + { + "id": "2,2", + "x": 1.0, + "y": 2.25 + }, + { + "id": "2,5", + "x": 4.0, + "y": 2.25 + }, + { + "id": "7,5", + "x": 9.5, + "y": 2.25 + }, + { + "id": "7,2", + "x": 12.5, + "y": 2.25 + }, + { + "id": "2,1", + "x": 0.0, + "y": 2.6 + }, + { + "id": "7,1", + "x": 13.5, + "y": 2.6 + }, + { + "id": "4,3", + "x": 2.0, + "y": 3.0 + }, + { + "id": "9,3", + "x": 11.5, + "y": 3.0 + }, + { + "id": "4,2", + "x": 1.0, + "y": 3.25 + }, + { + "id": "9,2", + "x": 12.5, + "y": 3.25 + }, + { + "id": "4,4", + "x": 3.15, + "y": 3.5 + }, + { + "id": "9,4", + "x": 10.35, + "y": 3.5 + }, + { + "id": "4,1", + "x": 0.0, + "y": 3.6 + }, + { + "id": "9,1", + "x": 13.5, + "y": 3.6 + }, + { + "id": "4,5", + "x": 4.279, + "y": 3.594 + }, + { + "id": "4,6", + "x": 5.359, + "y": 3.9 + }, + { + "id": "9,6", + "x": 8.14, + "y": 3.908 + }, + { + "id": "9,5", + "x": 9.224, + "y": 3.614 + } ], "layers": [ - {"name": "L0 基本", "matrix": [ - ["0x0000", "0x0014", "0x001a", "0x0008", "0x0015", "0x0017", "0x0000"], - ["0x0000", "0x0004", "0x0016", "0x4307", "0x4209", "0x000a", "0x0000"], - ["0x0000", "0x001d", "0x001b", "0x4506", "0x4419", "0x4605", "0x0000"], - ["0x0000", "0x0000", "0x0000", "0x0000", "0x0000", "0x0000", "0x0000"], - ["0x0000", "0x0001", "0x00e3", "0x00e2", "0x00e0", "0x2828", "0x222c"], - ["0x0000", "0x0000", "0x0012", "0x410c", "0x0018", "0x001c", "0x0000"], - ["0x0000", "0x0013", "0x410f", "0x410e", "0x000d", "0x000b", "0x0000"], - ["0x0000", "0x5201", "0x0000", "0x0010", "0x0011", "0x0000", "0x0000"], - ["0x0000", "0x0000", "0x0000", "0x0000", "0x0000", "0x0000", "0x0000"], - ["0x0000", "0x410c", "0x0000", "0x0000", "0x0000", "0x3858", "0x322c"] - ]}, - {"name": "L1 マウス", "matrix": [ - ["0x0000", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0000"], - ["0x0000", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0000"], - ["0x0000", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0000"], - ["0x0000", "0x0000", "0x0000", "0x0000", "0x0000", "0x0000", "0x0000"], - ["0x0000", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0000", "0x0001", "0x00d5", "0x0001", "0x0001", "0x0001", "0x0000"], - ["0x0000", "0x00d2", "0x00d2", "0x7e19", "0x00d1", "0x00d4", "0x0000"], - ["0x0000", "0x5200", "0x0001", "0x00d1", "0x7e19", "0x0001", "0x0000"], - ["0x0000", "0x0000", "0x0000", "0x0000", "0x0000", "0x0000", "0x0000"], - ["0x0000", "0x7e19", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"] - ]}, - {"name": "L2 移動", "matrix": [ - ["0x0000", "0x0029", "0x0001", "0x002a", "0x0001", "0x0001", "0x0000"], - ["0x0000", "0x002b", "0x002b", "0x00e3", "0x0001", "0x0001", "0x0000"], - ["0x0000", "0x0001", "0x0001", "0x0001", "0x0001", "0x0073", "0x0000"], - ["0x0000", "0x0000", "0x0000", "0x0000", "0x0000", "0x0000", "0x0000"], - ["0x0000", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0000", "0x004c", "0x0001", "0x0001", "0x002a", "0x0001", "0x0000"], - ["0x0000", "0x0001", "0x004f", "0x0052", "0x0051", "0x0050", "0x0000"], - ["0x0000", "0x0001", "0x0001", "0x7700", "0x7700", "0x0001", "0x0000"], - ["0x0000", "0x0000", "0x0000", "0x0000", "0x0000", "0x0000", "0x0000"], - ["0x0000", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"] - ]}, - {"name": "L3 数字", "matrix": [ - ["0x0000", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0000"], - ["0x0000", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0000"], - ["0x0000", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0000"], - ["0x0000", "0x0000", "0x0000", "0x0000", "0x0000", "0x0000", "0x0000"], - ["0x0000", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0000", "0x0000", "0x0026", "0x0025", "0x0024", "0x0001", "0x0000"], - ["0x0000", "0x0027", "0x0023", "0x0022", "0x0021", "0x0001", "0x0000"], - ["0x0000", "0x0001", "0x0020", "0x001f", "0x001e", "0x0001", "0x0000"], - ["0x0000", "0x0000", "0x0000", "0x0000", "0x0000", "0x0000", "0x0000"], - ["0x0000", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"] - ]}, - {"name": "L4 記号", "matrix": [ - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0030", "0x002f", "0x002e", "0x002d", "0x0001"], - ["0x0001", "0x0001", "0x0032", "0x0034", "0x0033", "0x0089", "0x0001"], - ["0x0001", "0x0087", "0x0038", "0x0037", "0x0036", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"] - ]}, - {"name": "L5 ファンクション", "matrix": [ - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0043", "0x0042", "0x0041", "0x0040", "0x0001", "0x0001"], - ["0x0001", "0x0044", "0x003f", "0x003e", "0x003d", "0x0045", "0x0001"], - ["0x0001", "0x0001", "0x003c", "0x003b", "0x003a", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"] - ]}, - {"name": "L6 記号・システム", "matrix": [ - ["0x0001", "0x00a5", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x001e", "0x0001", "0x00a6", "0x00a6", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x00b0", "0x00e3", "0x00e2", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x00a6", "0x0035", "0x002d", "0x002a", "0x002e", "0x0001"], - ["0x0001", "0x0038", "0x0032", "0x0030", "0x0030", "0x0231", "0x0001"], - ["0x0001", "0x0087", "0x0064", "0x002f", "0x0034", "0x0031", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0087", "0x0034", "0x0001", "0x0001", "0x0001"] - ]}, - {"name": "L7 マウス", "matrix": [ - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x00d5", "0x0001", "0x00d4", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x00d2", "0x7e19", "0x00d1", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"], - ["0x0001", "0x7e19", "0x0001", "0x0001", "0x0001", "0x0001", "0x0001"] - ]} + { + "name": "L0 基本", + "matrix": [ + [ + "0x0000", + "0x0014", + "0x001a", + "0x0008", + "0x0015", + "0x0017", + "0x0000" + ], + [ + "0x0000", + "0x0004", + "0x0016", + "0x4307", + "0x4209", + "0x000a", + "0x0000" + ], + [ + "0x0000", + "0x211d", + "0x001b", + "0x4506", + "0x4419", + "0x4605", + "0x0000" + ], + [ + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000" + ], + [ + "0x0000", + "0x0039", + "0x00e3", + "0x00e2", + "0x00e2", + "0x2828", + "0x222c" + ], + [ + "0x0000", + "0x0000", + "0x0012", + "0x410c", + "0x0018", + "0x001c", + "0x0000" + ], + [ + "0x0000", + "0x0013", + "0x000f", + "0x410e", + "0x000d", + "0x000b", + "0x0000" + ], + [ + "0x0000", + "0x5201", + "0x0000", + "0x0010", + "0x0011", + "0x0000", + "0x0000" + ], + [ + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000" + ], + [ + "0x0000", + "0x5200", + "0x0000", + "0x0000", + "0x0000", + "0x3858", + "0x322c" + ] + ] + }, + { + "name": "L1 マウス", + "matrix": [ + [ + "0x0000", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0000" + ], + [ + "0x0000", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0000" + ], + [ + "0x0000", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0000" + ], + [ + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000" + ], + [ + "0x0000", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0000", + "0x0001", + "0x00d5", + "0x0001", + "0x0001", + "0x0001", + "0x0000" + ], + [ + "0x0000", + "0x00d2", + "0x00d2", + "0x7e19", + "0x00d1", + "0x00d4", + "0x0000" + ], + [ + "0x0000", + "0x5200", + "0x0001", + "0x00d1", + "0x7e19", + "0x0001", + "0x0000" + ], + [ + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000" + ], + [ + "0x0000", + "0x5200", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ] + ] + }, + { + "name": "L2 移動", + "matrix": [ + [ + "0x0000", + "0x0029", + "0x0001", + "0x002a", + "0x0001", + "0x0001", + "0x0000" + ], + [ + "0x0000", + "0x002b", + "0x002b", + "0x00e3", + "0x0001", + "0x0001", + "0x0000" + ], + [ + "0x0000", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0073", + "0x0000" + ], + [ + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000" + ], + [ + "0x0000", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0000", + "0x004c", + "0x0001", + "0x0001", + "0x002a", + "0x0001", + "0x0000" + ], + [ + "0x0000", + "0x0001", + "0x004f", + "0x0052", + "0x0051", + "0x0050", + "0x0000" + ], + [ + "0x0000", + "0x0001", + "0x0001", + "0x0090", + "0x0091", + "0x0001", + "0x0000" + ], + [ + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000" + ], + [ + "0x0000", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ] + ] + }, + { + "name": "L3 数字", + "matrix": [ + [ + "0x0000", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0000" + ], + [ + "0x0000", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0000" + ], + [ + "0x0000", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0000" + ], + [ + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000" + ], + [ + "0x0000", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0000", + "0x0000", + "0x0026", + "0x0025", + "0x0024", + "0x0001", + "0x0000" + ], + [ + "0x0000", + "0x0027", + "0x0023", + "0x0022", + "0x0021", + "0x0001", + "0x0000" + ], + [ + "0x0000", + "0x0001", + "0x0020", + "0x001f", + "0x001e", + "0x0001", + "0x0000" + ], + [ + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000", + "0x0000" + ], + [ + "0x0000", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ] + ] + }, + { + "name": "L4 記号", + "matrix": [ + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x002f", + "0x002e", + "0x002d", + "0x0089", + "0x0001" + ], + [ + "0x0001", + "0x0030", + "0x0031", + "0x0034", + "0x0033", + "0x0235", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0038", + "0x0037", + "0x0036", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ] + ] + }, + { + "name": "L5 ファンクション", + "matrix": [ + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0043", + "0x0042", + "0x0041", + "0x0040", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0044", + "0x003f", + "0x003e", + "0x003d", + "0x0045", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x003c", + "0x003b", + "0x003a", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ] + ] + }, + { + "name": "L6 記号・システム", + "matrix": [ + [ + "0x0001", + "0x00a5", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x001e", + "0x0001", + "0x00a6", + "0x00a6", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x00b0", + "0x00e3", + "0x00e2", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x00a6", + "0x0035", + "0x002d", + "0x002a", + "0x002e", + "0x0001" + ], + [ + "0x0001", + "0x0038", + "0x0032", + "0x0030", + "0x0030", + "0x0231", + "0x0001" + ], + [ + "0x0001", + "0x0087", + "0x0064", + "0x002f", + "0x0034", + "0x0031", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0087", + "0x0034", + "0x0001", + "0x0001", + "0x0001" + ] + ] + }, + { + "name": "L7 マウス", + "matrix": [ + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x00d5", + "0x0001", + "0x00d4", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x00d2", + "0x7e19", + "0x00d1", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ], + [ + "0x0001", + "0x5200", + "0x0001", + "0x0001", + "0x0001", + "0x0001", + "0x0001" + ] + ] + } ], "custom_keycodes": { "0x7e00": "SEL\nBLE", diff --git a/.config/karabiner/torabo-tsuki-s.md b/.config/karabiner/torabo-tsuki-s.md index 0175255..5d6f994 100644 --- a/.config/karabiner/torabo-tsuki-s.md +++ b/.config/karabiner/torabo-tsuki-s.md @@ -15,7 +15,7 @@ swiftc -module-cache-path /private/tmp/torabo-swift-cache \ /private/tmp/torabo-keymap-device apply-key ~/.config/karabiner/torabo-tsuki-s.json 2 2 5 0x0001 ``` -Toraboでは `f` を長押ししてから `b` を押すと、移動レイヤーのB位置が表示用の `F24` を送り、Karabinerがキー一覧を開きます。通常の `f` と `b` の短押しは元の設定を使います。内蔵キーボードの `f + b` でも接続に応じて表示を選びます。編集用JSONはキー一覧を開くたびに読み直されます。 +Toraboでは `f` を長押ししてから `b` を押すと、移動レイヤーのB位置が表示用の `F24` を送り、Karabinerがキー一覧を開きます。同じ `f` 保持中の `n` が英数(ABC)、`m` がかな(あいう)です(ZMKでは `LANG2` / `LANG1`)。通常の `f`・`n`・`m`・`b` の短押しは元の設定を使います。内蔵キーボードの `f + b` / `f + n` / `f + m` でも同じ役割です。編集用JSONはキー一覧を開くたびに読み直されます。 物理配置は[製作者のVial定義](https://github.com/sekigon-gonnoc/vial-qmk/blob/dev/ble-micro-pro/keyboards/sekigon/torabo_tsuki/keymaps/vial/vial.json)を基にしました。読み取り・編集には[Vialの公式プロトコル](https://github.com/vial-kb/vial-gui/blob/main/src/main/python/protocol/keyboard_comm.py)を使います。 diff --git a/.config/torabo-zmk/README.md b/.config/torabo-zmk/README.md index 17430a6..c98874e 100644 --- a/.config/torabo-zmk/README.md +++ b/.config/torabo-zmk/README.md @@ -13,7 +13,7 @@ 2. mainに変更が入るとビルドが始まります。手動でビルドするときは [GitHub ActionsのToraboビルド](https://github.com/ishiooon/dotfiles/actions/workflows/torabo-zmk.yml) で「Run workflow」を選びます。 3. 成功した実行結果の「Artifacts」から `torabo-tsuki-s-firmware` をダウンロードします。ZIPには右親機と左子機の `.uf2` と、使った依存関係の一覧が入っています。 -ブラウザからの編集・ビルドはMac、Windows、Linuxで同じ手順です。MacのF長押し+Bによるキー一覧にはKarabiner-Elementsが必要です。 +ブラウザからの編集・ビルドはMac、Windows、Linuxで同じ手順です。MacのF長押し+Bによるキー一覧にはKarabiner-Elementsが必要です。Torabo本体では `F` 押し込み中の `N` が英数(ABC)、`M` がかな(あいう)です。内蔵キーボードでは Karabiner の `f+n` / `f+m` が同じ役割です。 ### 手元でビルドする @@ -33,6 +33,25 @@ ZMK Studioで入力を保存したことがある場合は、再書き込み後 左右の電源を入れ、最初は右をUSBで給電したままMacのBluetooth設定から `Torabo-tsuki S` に接続します。旧 `(BMP)torabo-tsuki` の登録と競合する場合は、Macでその機器の登録を解除してから再検索します。[ZMKのBluetooth接続の切り分け](https://zmk.dev/docs/troubleshooting/connection-issues) +接続がくるくるのまま進まないときは、Macから機器を削除したうえで、右をUSB接続したまま `B` を押しながら `D`(BT消去)→ `F`(プロファイル0)を押し、再度ペアします。settings reset ファームは、ブートローダに戻れないと復帰できないため常用しません。 + +### Bluetoothが繋がらないとき(settings reset) + +Macの一覧に出ても接続がくるくるのまま進まないときは、左右のBluetooth記憶を消してから通常ファームを書き直します。ビルド成果物の `settings-reset-ble-micro-pro.uf2` を使います。 + +1. MacのBluetoothから `Torabo-tsuki S` を削除する。 +2. 右をUSB接続し、ブートローダ(`BLEMICROPRO`)を起動して `settings-reset-ble-micro-pro.uf2` を入れる。 +3. **USBを抜き → 電源オン → もう一度USBを挿す**(書き込みだけではリセットが完了しない)。 +4. 左も同じ手順で settings reset する。 +5. 右に `torabo-tsuki-s-right-central.uf2`、左に `torabo-tsuki-s-left-peripheral.uf2` を書き込む。 +6. 左右の電源を入れ、右をUSB給電したままBluetoothで再ペアする。 + +ブートローダの出し方: + +- **常用:** `B` を押しながら `P` でブートローダ(`BLEMICROPRO`)に入ります。通常の `P` 単体は文字入力のままです。 +- **予備:** USB接続中にシリアルを1200bpsで開いて閉じる。`ls /dev/tty.usb*` でポートを確認し、`screen /dev/tty.usbmodem… 1200` のあと `Ctrl+a` → `k` → `y`。 +- **settings reset 直後など、通常起動しないとき:** マイコンの BOOT と GND をショートしたままUSB接続します。 + Bluetooth接続ではZMK版がキーボードとマウスの両方として認識されます。Karabinerはマウスを既定で処理対象から外すため、[Karabinerの設定](../karabiner/karabiner.json)ではこのToraboだけを明示的に処理対象にしています。ToraboのFを長押ししながらBを押すと、Bを押している間にキー一覧が表示されます。 ## Vialに戻すとき diff --git a/.config/torabo-zmk/build-local.sh b/.config/torabo-zmk/build-local.sh index c87c974..af45f56 100644 --- a/.config/torabo-zmk/build-local.sh +++ b/.config/torabo-zmk/build-local.sh @@ -123,7 +123,7 @@ run_build() { west manifest --freeze --active-only > resolved-west.yml ' - # ネットワークから切り離して、右のトラックボール側と左の子機をコンパイルする。 + # ネットワークから切り離して、右・左・Bluetooth設定リセット用をコンパイルする。 "$docker_cli" run "${sandbox[@]}" --network none "$IMAGE" bash -ec ' export ZEPHYR_BASE=/workspace/zephyr CMAKE_BUILD_PARALLEL_LEVEL=4 west zephyr-export @@ -136,10 +136,13 @@ run_build() { -S studio-rpc-usb-uart -- -DZMK_CONFIG=/workspace/config \ "-DSHIELD=torabo_tsuki_$half" "${role[@]}" done + west build -p always -s zmk/app -d build-settings-reset -b ble_micro_pro -- \ + -DSHIELD=settings_reset cp build-right/zephyr/zmk.uf2 firmware/torabo-tsuki-s-right-central.uf2 cp build-left/zephyr/zmk.uf2 firmware/torabo-tsuki-s-left-peripheral.uf2 + cp build-settings-reset/zephyr/zmk.uf2 firmware/settings-reset-ble-micro-pro.uf2 ' - printf '左右のファームウェア %s/firmware\n' "$workspace" + printf '左右と settings reset のファームウェア %s/firmware\n' "$workspace" } main "$@" diff --git a/.config/torabo-zmk/config/torabo_tsuki.conf b/.config/torabo-zmk/config/torabo_tsuki.conf index 34deeaf..06c3831 100644 --- a/.config/torabo-zmk/config/torabo_tsuki.conf +++ b/.config/torabo-zmk/config/torabo_tsuki.conf @@ -13,3 +13,6 @@ CONFIG_BT_DIS_PNP_PID=0xBCAD # 現在の実機と同じカーソル分解能と、自動でマウスレイヤーから戻るまでの時間を使う。 CONFIG_PMW3610_CPI=600 CONFIG_PMW3610_AUTOMOUSE_TIMEOUT_MS=664 + +# 一部MacでBluetoothペアリングが途中で止まるのを避ける。 +CONFIG_BT_CTLR_PHY_2M=n diff --git a/.config/torabo-zmk/config/torabo_tsuki.keymap b/.config/torabo-zmk/config/torabo_tsuki.keymap index d584327..f0325fb 100644 --- a/.config/torabo-zmk/config/torabo_tsuki.keymap +++ b/.config/torabo-zmk/config/torabo_tsuki.keymap @@ -1,5 +1,6 @@ #include #include +#include #include #include "torabo-pointing.dtsi" @@ -17,6 +18,7 @@ <¯o_tap &kp SPACE>, <¯o_release &kp LCTRL>; ) + }; keymap { @@ -27,9 +29,9 @@ display-name = "基本"; bindings = < &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U < 1 I &kp O &none - &kp A &kp S < 3 D < 2 F &kp G &kp H &kp J < 1 K < 1 L &kp P - &kp Z &kp X < 5 C < 4 V < 6 B &none &kp N &kp M &none &to 1 - &trans &kp LGUI &kp LALT &kp LCTRL &mt LGUI RET &mt LSHFT SPACE &mt RSHFT SPACE &mt RGUI KP_ENTER &none &none &none < 1 I + &kp A &kp S < 3 D < 2 F &kp G &kp H &kp J < 1 K &kp L &kp P + &mt LCTRL Z &kp X < 5 C < 4 V < 6 B &none &kp N &kp M &none &to 1 + &kp CAPSLOCK &kp LGUI &kp LALT &kp LALT &mt LGUI RET &mt LSHFT SPACE &mt RSHFT SPACE &mt RGUI KP_ENTER &none &none &none &to 0 >; }; @@ -39,17 +41,19 @@ &trans &trans &trans &trans &trans &trans &trans &trans &mkp MB5 &trans &trans &trans &trans &trans &trans &mkp MB4 &mkp LCLK &mo 8 &mkp RCLK &mkp RCLK &trans &trans &trans &trans &trans &trans &mo 8 &mkp LCLK &trans &to 0 - &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &mo 8 + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &to 0 >; }; // 左手のFを保持してBを押すと、Macでキー一覧を開くF24を送る。 + // F+Nで英数(ABC)、F+Mでかな(あいう)。MacのLANG2/LANG1に対応する。 + // 一番右下は全レイヤーで &to 0(基本レイヤーへ強制復帰)。 layer_2 { display-name = "移動"; bindings = < &kp ESC &trans &kp BSPC &trans &trans &trans &kp BSPC &trans &trans &kp DEL &kp TAB &kp TAB &kp LGUI &trans &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans - &trans &trans &trans &trans &kp F24 &trans &ctrl_space &ctrl_space &trans &trans + &trans &trans &trans &trans &kp F24 &trans &kp LANG2 &kp LANG1 &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans >; }; @@ -64,12 +68,14 @@ >; }; + // Karabinerのv長押しと同じ記号配置(右手)。 + // Y¥ U- I= O[ / H~ J; K' L\ P] / N, M. (M右隣)/ layer_4 { display-name = "記号"; bindings = < - &trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &trans - &trans &trans &trans &trans &trans &kp INTERNATIONAL_3 &kp SEMI &kp SQT &kp NON_US_HASH &trans - &trans &trans &trans &trans &trans &trans &kp COMMA &kp DOT &kp FSLH &kp INTERNATIONAL_1 + &trans &trans &trans &trans &trans &kp INTERNATIONAL_3 &kp MINUS &kp EQUAL &kp LBKT &trans + &trans &trans &trans &trans &trans &kp LS(GRAVE) &kp SEMI &kp SQT &kp BSLH &kp RBKT + &trans &trans &trans &trans &trans &trans &kp COMMA &kp DOT &kp FSLH &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans >; }; @@ -85,11 +91,12 @@ }; // このZMK版が送信できるConsumerページの電源とスリープを使用する。 + // B長押し+Dで現在のBTプロファイル消去、B長押し+Fでプロファイル0選択(Mac再ペア用)。 layer_6 { display-name = "記号・電源"; bindings = < &kp C_POWER &trans &trans &trans &trans &kp EQUAL &kp BSPC &kp MINUS &kp GRAVE &kp C_SLEEP - &kp N1 &trans &kp C_SLEEP &kp C_SLEEP &trans &kp LS(BSLH) &kp RBKT &kp RBKT &kp NON_US_HASH &kp FSLH + &kp N1 &trans &bt BT_CLR &bt BT_SEL 0 &trans &kp LS(BSLH) &kp RBKT &kp RBKT &kp NON_US_HASH &bootloader &trans &kp C_EJECT &kp LGUI &kp LALT &trans &kp BSLH &kp SQT &kp LBKT &kp NON_US_BSLH &kp INTERNATIONAL_1 &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp SQT &kp INTERNATIONAL_1 &trans >; @@ -101,7 +108,7 @@ &trans &trans &trans &trans &trans &trans &mkp MB4 &trans &mkp MB5 &trans &trans &trans &trans &trans &trans &trans &mkp LCLK &mo 8 &mkp RCLK &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans - &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &mo 8 + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &to 0 >; }; diff --git a/.github/workflows/torabo-zmk.yml b/.github/workflows/torabo-zmk.yml index c861ecd..acb3770 100644 --- a/.github/workflows/torabo-zmk.yml +++ b/.github/workflows/torabo-zmk.yml @@ -43,5 +43,6 @@ jobs: path: | ${{ runner.temp }}/torabo-zmk/firmware/torabo-tsuki-s-right-central.uf2 ${{ runner.temp }}/torabo-zmk/firmware/torabo-tsuki-s-left-peripheral.uf2 + ${{ runner.temp }}/torabo-zmk/firmware/settings-reset-ble-micro-pro.uf2 ${{ runner.temp }}/torabo-zmk/resolved-west.yml if-no-files-found: error diff --git a/tests/karabiner_torabo_shortcut_test.sh b/tests/karabiner_torabo_shortcut_test.sh index 7c18aa7..64a6c11 100644 --- a/tests/karabiner_torabo_shortcut_test.sh +++ b/tests/karabiner_torabo_shortcut_test.sh @@ -26,11 +26,34 @@ assert shortcut["to"][0]["shell_command"].endswith("keymap-hud show'") assert shortcut["to_after_key_up"][0]["shell_command"].endswith("keymap-hud hide'") assert any(m["from"].get("key_code") == "b" and m.get("to", [{}])[0].get("shell_command", "").endswith("keymap-hud show'") for m in changes) -# ZMK ではキー入力とカーソル操作が一つの機器として届くため、その Torabo の入力が変換の対象になることを確認する。 +# ZMK ではキー入力とカーソル操作が一つの機器として届く。無視はせず、F24 以外の変換だけ外す。 torabo_identifiers = { "vendor_id": 65261, "product_id": 48301, "is_keyboard": True, "is_pointing_device": True } torabo_devices = [device for device in active.get("devices", []) if device["identifiers"] == torabo_identifiers] assert len(torabo_devices) == 1 and torabo_devices[0].get("ignore") is False, "ZMK 版 Torabo のキー入力が変換の対象になっていません。" + +def targets_torabo_only(manipulator): + for condition in manipulator.get("conditions") or []: + if condition.get("type") != "device_if": + continue + for ident in condition.get("identifiers") or []: + if ident.get("vendor_id") == 65261 and ident.get("product_id") == 48301: + return True + return False + +def excludes_torabo(manipulator): + for condition in manipulator.get("conditions") or []: + if condition.get("type") != "device_unless": + continue + for ident in condition.get("identifiers") or []: + if ident.get("vendor_id") == 65261 and ident.get("product_id") == 48301: + return True + return False + +for manipulator in changes: + if targets_torabo_only(manipulator): + continue + assert excludes_torabo(manipulator), "Torabo 向け以外の Karabiner 変換が Torabo にも掛かっています。" print("成功: 既存の f + b と、Torabo の入力設定および表示・非表示指示を確認しました。") PY diff --git a/tests/torabo_zmk_keymap_test.sh b/tests/torabo_zmk_keymap_test.sh index 96e47cd..63bb4cd 100644 --- a/tests/torabo_zmk_keymap_test.sh +++ b/tests/torabo_zmk_keymap_test.sh @@ -26,7 +26,19 @@ assert list(layers) == [*(f"layer_{index}" for index in range(8)), "drag_scroll" # 通常キーは変更できる。Macのキー一覧とドラッグスクロールに必要な予約位置だけを検証する。 base = layers["layer_0"] assert base[13] == "< 2 F", "F長押しでキー一覧のレイヤーに入る" +assert base[18] == "&kp L", "Lは単純なL" +assert base[20] == "&mt LCTRL Z", "Z長押しはControl" +assert base[30] == "&kp CAPSLOCK", "一番左下はCaps" +assert base[31] == "&kp LGUI", "Capsの右はCommand" +assert base[32] == "&kp LALT", "左親指の内側はOption" +assert base[33] == "&kp LALT", "左Enterの左はOption" +assert base[41] == "&to 0", "一番右下は基本レイヤーへ強制復帰" assert layers["layer_2"][24] == "&kp F24", "F長押しとBでキー一覧を開く" +# L4記号はKarabinerのv長押しと同じ配置。 +symbols = layers["layer_4"] +assert symbols[5:9] == ["&kp INTERNATIONAL_3", "&kp MINUS", "&kp EQUAL", "&kp LBKT"], "v層 Y¥ U- I= O[" +assert symbols[15:20] == ["&kp LS(GRAVE)", "&kp SEMI", "&kp SQT", "&kp BSLH", "&kp RBKT"], "v層 H~ J; K' L\\ P]" +assert symbols[26:29] == ["&kp COMMA", "&kp DOT", "&kp FSLH"], "v層 N, M. /" assert all(binding == "&trans" for binding in layers["drag_scroll"]), "スクロール中も他のキー操作を透過する" print("成功: ZMKのS配列と主要なキー操作を確認しました。") PY From 9c908774133546171e52b6cac91bbdc5d9f8628c Mon Sep 17 00:00:00 2001 From: Hiroki Ishio Date: Tue, 24 Nov 2026 14:11:04 +0900 Subject: [PATCH 2/5] =?UTF-8?q?f+b=E3=81=AB=E9=9B=BB=E6=B1=A0=E6=AE=8B?= =?UTF-8?q?=E9=87=8F=E3=82=92=E5=87=BA=E3=81=97=E3=80=81K=E9=95=B7?= =?UTF-8?q?=E6=8A=BC=E3=81=97=E3=81=A7=E7=A2=BA=E5=AE=9F=E3=81=AB=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E3=83=AD=E3=83=BC=E3=83=AB=E3=81=99=E3=82=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HUDがBLEの残量キャッシュを見出しに表示し、Kは短いhold-tapでスクロール層へ入るようにする。 Co-authored-by: Cursor --- .bin/karabiner-keymap-hud | 29 ++++- .config/karabiner/scripts/keymap-hud.html | 10 +- .config/karabiner/scripts/keymap-hud.js | 22 +++- .../karabiner/scripts/torabo-battery.swift | 112 ++++++++++++++++++ .config/karabiner/torabo-tsuki-s.json | 2 +- .config/torabo-zmk/README.md | 2 +- .config/torabo-zmk/config/torabo_tsuki.conf | 5 + .config/torabo-zmk/config/torabo_tsuki.keymap | 11 +- tests/karabiner_torabo_hud_test.sh | 9 +- tests/torabo_zmk_keymap_test.sh | 2 + 10 files changed, 192 insertions(+), 12 deletions(-) create mode 100644 .config/karabiner/scripts/torabo-battery.swift diff --git a/.bin/karabiner-keymap-hud b/.bin/karabiner-keymap-hud index 51c7a27..7ab20d5 100755 --- a/.bin/karabiner-keymap-hud +++ b/.bin/karabiner-keymap-hud @@ -13,12 +13,16 @@ readonly PID_FILE="$STATE_DIR/daemon.pid" readonly CMD_FILE="$STATE_DIR/command" readonly LOG_FILE="$STATE_DIR/hud.log" readonly HIDUTIL="${KARABINER_HUD_HIDUTIL:-/usr/bin/hidutil}" +readonly BATTERY_SWIFT="${KARABINER_TORABO_BATTERY_SWIFT:-$DOTFILES_DIR/.config/karabiner/scripts/torabo-battery.swift}" +readonly BATTERY_BIN="$STATE_DIR/torabo-battery" +readonly BATTERY_JSON="$STATE_DIR/torabo-battery.json" usage() { cat <<'USAGE' Usage: karabiner-keymap-hud show|hide|status|start|stop f + b で使用するキー一覧を表示または非表示にします。 +Torabo 接続時は直近の電池残量も見出しに出します。 USAGE } @@ -64,12 +68,35 @@ start_daemon() { printf '[ERROR] HUD デーモンの起動に失敗しました。詳細: %s\n' "$LOG_FILE" >&2 exit 1 } + if torabo_connected; then + refresh_battery_async + fi +} + +ensure_battery_bin() { + [[ -x "$BATTERY_BIN" ]] && return 0 + [[ -f "$BATTERY_SWIFT" ]] || return 1 + mkdir -p "$STATE_DIR" + /usr/bin/swiftc -module-cache-path "$STATE_DIR/swift-cache" -O "$BATTERY_SWIFT" -o "$BATTERY_BIN" 2>>"$LOG_FILE" || return 1 + return 0 +} + +# 表示を止めないよう裏で更新し、次回以降の f+b で使う。 +refresh_battery_async() { + ensure_battery_bin || return 0 + ( + "$BATTERY_BIN" >"$BATTERY_JSON.tmp" 2>>"$LOG_FILE" && mv "$BATTERY_JSON.tmp" "$BATTERY_JSON" + ) >/dev/null 2>&1 & + disown || true } show_hud() { start_daemon local display=show - if torabo_connected; then display='show torabo'; fi + if torabo_connected; then + display='show torabo' + refresh_battery_async + fi printf '%s\n' "$display" >"$CMD_FILE" } diff --git a/.config/karabiner/scripts/keymap-hud.html b/.config/karabiner/scripts/keymap-hud.html index 248f6f7..a233c19 100644 --- a/.config/karabiner/scripts/keymap-hud.html +++ b/.config/karabiner/scripts/keymap-hud.html @@ -334,7 +334,7 @@

Keymap Layers · JIS shape / US legends

-
f + b で表示 · 離すと閉じる · Gruvbox Material
+
f + b で表示 · 離すと閉じる · Gruvbox Material
@@ -508,6 +508,7 @@

Keymap Layers · JIS shape / US legends

function showKeymap(profile) { const root = document.getElementById("layers"); const title = document.querySelector("#keymap-title"); + const sub = document.querySelector("#keymap-sub"); const split = profile === "torabo" ? window.__TORABO_KEYMAP__ : null; const useSplit = Boolean(split && Array.isArray(split.keys) && split.keys.length && split.keys.every((key) => key && Number.isFinite(key.x) && Number.isFinite(key.y)) && @@ -516,12 +517,19 @@

Keymap Layers · JIS shape / US legends

root.replaceChildren(); if (useSplit) { title.textContent = split.name || "Torabo-tsuki (S)"; + if (sub) { + const battery = window.__TORABO_BATTERY_SUBTITLE__ || ""; + sub.textContent = battery + ? `${battery} · f + b で表示 · 離すと閉じる` + : "f + b で表示 · 離すと閉じる · 電池取得中"; + } renderToraboKeymap(root, split); return "torabo"; } const def = window.__KEYMAP_LAYERS__; if (!def) throw new Error("JISの配列データがありません。"); title.textContent = "Keymap Layers · JIS shape / US legends"; + if (sub) sub.textContent = "f + b で表示 · 離すと閉じる · Gruvbox Material"; for (const layer of def.layers) root.appendChild(renderLayer(layer, def)); return "jis"; } diff --git a/.config/karabiner/scripts/keymap-hud.js b/.config/karabiner/scripts/keymap-hud.js index 5645e75..fb1ffee 100755 --- a/.config/karabiner/scripts/keymap-hud.js +++ b/.config/karabiner/scripts/keymap-hud.js @@ -43,14 +43,27 @@ function buildHtmlDocument(html, jsonText, toraboModel) { return `${injection}\n${html}`; } -function keymapDisplayScript(command, path) { +function batterySubtitle(path) { + try { + const battery = JSON.parse(readText(path)); + const parts = []; + if (Number.isFinite(battery.right)) parts.push(`右 ${battery.right}%`); + if (Number.isFinite(battery.left)) parts.push(`左 ${battery.left}%`); + if (parts.length) return parts.join(" · "); + } catch (error) {} + return ""; +} + +function keymapDisplayScript(command, path, batteryPath) { const showJis = 'window.showKeymap("jis")'; if (command !== "show torabo") return showJis; try { - // 表示のたびに編集用 JSON を読み込む。欠損や不正値があれば内蔵用の表示を使う。 + // 表示のたびに編集用 JSON と、HUD キャッシュの電池残量を読み込む。 const definition = JSON.stringify(JSON.parse(readText(path))); + const subtitle = (batteryPath && batterySubtitle(batteryPath)) || "電池は次回の表示で更新されます"; return `try { window.__TORABO_KEYMAP__ = buildToraboKeymap(JSON.parse(${JSON.stringify(definition)})); + window.__TORABO_BATTERY_SUBTITLE__ = ${JSON.stringify(subtitle)}; window.showKeymap("torabo"); } catch (error) { ${showJis}; }`; } catch (error) { @@ -123,9 +136,10 @@ function run(argv) { } lastCmd = cmd; if (cmd === "show" || cmd === "show torabo") { - // 表示内容を切り替えてからパネルを開く。 + // 表示内容を切り替えてからパネルを開く。電池は同ディレクトリのキャッシュを読む。 + const batteryPath = cmdPath.replace(/[^/]+$/, "torabo-battery.json"); webView.evaluateJavaScriptCompletionHandler( - keymapDisplayScript(cmd, configDir + "torabo-tsuki-s.json"), + keymapDisplayScript(cmd, configDir + "torabo-tsuki-s.json", batteryPath), function () { // 読み込み中にキーが離された場合は、すでに非表示になったパネルを開き直さない。 if (lastCmd === cmd) { diff --git a/.config/karabiner/scripts/torabo-battery.swift b/.config/karabiner/scripts/torabo-battery.swift new file mode 100644 index 0000000..7644ce0 --- /dev/null +++ b/.config/karabiner/scripts/torabo-battery.swift @@ -0,0 +1,112 @@ +import CoreBluetooth +import Foundation + +/// 接続済みの Torabo-tsuki S から BLE Battery Service を読み、JSON を標準出力する。 + +final class Reader: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate { + private let bas = CBUUID(string: "180F") + private let level = CBUUID(string: "2A19") + private var central: CBCentralManager! + private var pending = 0 + private var percents: [Int] = [] + private var finished = false + private let timeout: TimeInterval = 2.0 + + func start() { + central = CBCentralManager( + delegate: self, + queue: nil, + options: [CBCentralManagerOptionShowPowerAlertKey: false] + ) + DispatchQueue.main.asyncAfter(deadline: .now() + timeout) { [weak self] in + self?.emit(error: "timeout") + } + } + + func centralManagerDidUpdateState(_ central: CBCentralManager) { + guard central.state == .poweredOn else { + emit(error: "bluetooth_off") + return + } + let connected = central.retrieveConnectedPeripherals(withServices: [bas]) + .filter { ($0.name ?? "").localizedCaseInsensitiveContains("torabo") } + guard !connected.isEmpty else { + emit(error: "not_connected") + return + } + for peripheral in connected { + peripheral.delegate = self + pending += 1 + if peripheral.state == .connected { + peripheral.discoverServices([bas]) + } else { + central.connect(peripheral, options: nil) + } + } + } + + func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) { + peripheral.discoverServices([bas]) + } + + func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) { + completeOne() + } + + func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) { + guard let service = peripheral.services?.first(where: { $0.uuid == bas }) else { + completeOne() + return + } + peripheral.discoverCharacteristics([level], for: service) + } + + func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) { + let levels = service.characteristics?.filter { $0.uuid == level } ?? [] + guard !levels.isEmpty else { + completeOne() + return + } + // 中央+子機の2特性がある場合、追加分を待ち数に足す。 + pending += levels.count - 1 + for characteristic in levels { + peripheral.readValue(for: characteristic) + } + } + + func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) { + if characteristic.uuid == level, let value = characteristic.value?.first { + percents.append(Int(value)) + } + completeOne() + } + + private func completeOne() { + pending = max(0, pending - 1) + if pending == 0 { + emit(error: nil) + } + } + + private func emit(error: String?) { + guard !finished else { return } + finished = true + // ZMK は中央(右)→ Peripheral 0(左)の順で返すことが多い。 + var payload: [String: Any] = [ + "updated_at": ISO8601DateFormatter().string(from: Date()) + ] + if percents.indices.contains(0) { payload["right"] = percents[0] } + if percents.indices.contains(1) { payload["left"] = percents[1] } + if let error, percents.isEmpty { payload["error"] = error } + if let data = try? JSONSerialization.data(withJSONObject: payload, options: [.sortedKeys]), + let text = String(data: data, encoding: .utf8) { + FileHandle.standardOutput.write(Data(text.utf8)) + FileHandle.standardOutput.write(Data("\n".utf8)) + } + exit(0) + } +} + +let reader = Reader() +reader.start() +RunLoop.main.run() diff --git a/.config/karabiner/torabo-tsuki-s.json b/.config/karabiner/torabo-tsuki-s.json index fbc0ace..4bde462 100644 --- a/.config/karabiner/torabo-tsuki-s.json +++ b/.config/karabiner/torabo-tsuki-s.json @@ -280,7 +280,7 @@ "0x0000", "0x0013", "0x000f", - "0x410e", + "0x480e", "0x000d", "0x000b", "0x0000" diff --git a/.config/torabo-zmk/README.md b/.config/torabo-zmk/README.md index c98874e..9649c15 100644 --- a/.config/torabo-zmk/README.md +++ b/.config/torabo-zmk/README.md @@ -52,7 +52,7 @@ Macの一覧に出ても接続がくるくるのまま進まないときは、 - **予備:** USB接続中にシリアルを1200bpsで開いて閉じる。`ls /dev/tty.usb*` でポートを確認し、`screen /dev/tty.usbmodem… 1200` のあと `Ctrl+a` → `k` → `y`。 - **settings reset 直後など、通常起動しないとき:** マイコンの BOOT と GND をショートしたままUSB接続します。 -Bluetooth接続ではZMK版がキーボードとマウスの両方として認識されます。Karabinerはマウスを既定で処理対象から外すため、[Karabinerの設定](../karabiner/karabiner.json)ではこのToraboだけを明示的に処理対象にしています。ToraboのFを長押ししながらBを押すと、Bを押している間にキー一覧が表示されます。 +Bluetooth接続ではZMK版がキーボードとマウスの両方として認識されます。Karabinerはマウスを既定で処理対象から外すため、[Karabinerの設定](../karabiner/karabiner.json)ではこのToraboだけを明示的に処理対象にしています(F24のキー一覧以外の変換は掛けません)。ToraboのFを長押ししながらBを押すと、Bを押している間にキー一覧と左右の電池残量が表示されます。初回は Bluetooth 許可が必要なことがあり、残量は次回表示から埋まる場合があります。 ## Vialに戻すとき diff --git a/.config/torabo-zmk/config/torabo_tsuki.conf b/.config/torabo-zmk/config/torabo_tsuki.conf index 06c3831..292acc6 100644 --- a/.config/torabo-zmk/config/torabo_tsuki.conf +++ b/.config/torabo-zmk/config/torabo_tsuki.conf @@ -16,3 +16,8 @@ CONFIG_PMW3610_AUTOMOUSE_TIMEOUT_MS=664 # 一部MacでBluetoothペアリングが途中で止まるのを避ける。 CONFIG_BT_CTLR_PHY_2M=n + +# 左右の電池残量を中央経由でホストへ伝える(f+bのキー一覧表示で参照する)。 +CONFIG_ZMK_BATTERY_REPORTING=y +CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_PROXY=y +CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y diff --git a/.config/torabo-zmk/config/torabo_tsuki.keymap b/.config/torabo-zmk/config/torabo_tsuki.keymap index f0325fb..c1a03b3 100644 --- a/.config/torabo-zmk/config/torabo_tsuki.keymap +++ b/.config/torabo-zmk/config/torabo_tsuki.keymap @@ -19,6 +19,15 @@ <¯o_release &kp LCTRL>; ) + // K長押しでスクロール層へ入る。ボール操作を待たず短めの判定にする。 + scroll_k: hold_tap { + compatible = "zmk,behavior-hold-tap"; + #binding-cells = <2>; + tapping-term-ms = <120>; + quick-tap-ms = <200>; + flavor = "hold-preferred"; + bindings = <&mo>, <&kp>; + }; }; keymap { @@ -29,7 +38,7 @@ display-name = "基本"; bindings = < &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U < 1 I &kp O &none - &kp A &kp S < 3 D < 2 F &kp G &kp H &kp J < 1 K &kp L &kp P + &kp A &kp S < 3 D < 2 F &kp G &kp H &kp J &scroll_k 8 K &kp L &kp P &mt LCTRL Z &kp X < 5 C < 4 V < 6 B &none &kp N &kp M &none &to 1 &kp CAPSLOCK &kp LGUI &kp LALT &kp LALT &mt LGUI RET &mt LSHFT SPACE &mt RSHFT SPACE &mt RGUI KP_ENTER &none &none &none &to 0 >; diff --git a/tests/karabiner_torabo_hud_test.sh b/tests/karabiner_torabo_hud_test.sh index 924dba0..b46c83d 100644 --- a/tests/karabiner_torabo_hud_test.sh +++ b/tests/karabiner_torabo_hud_test.sh @@ -38,18 +38,19 @@ function openKeymap(definition) { const script = html.match(/