-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Technical Details:
macOS version: macOS 15.2.0 (Sequoia)
Karabiner version: 15.3.0
Mac hardware: M4 Pro Mac mini
Keyboard hardware: Mac mini Magic Keyboard (Apple Inc.), Vendor ID: (0x004c), Product ID: (0x0322)
If I've slipped off the beam somewhere (or this has already been reported) please point out where.
Immediately after (re-)starting Karabiner, variables of type boolean and string do not appear under "Karabiner-EventViewer" >> "Variables" unless a variable of type integer is tested or assigned a value first. I've provided an example of what doesn't appear to work and a second example that does.
The following fragment doesn't appear to work as the variable tested doesn't appear under "Karabiner-EventViewer" >> "Variables" after Karabiner is (re-)started, both shift keys are pressed together, and Karabiner has had a chance to evaluate it. This appears to be the case even if the fragment appears first under "manipulators"; I suspect it's because "conditions" isn't satisfied:
...
{ "conditions": [ { "type": "variable_if",
"name": "variable_one",
"value": false
}
],
"from": { "simultaneous": [ { "key_code": "left_shift" },
{ "key_code": "right_shift" }
],
"simultaneous_options": { "key_down_order": "insensitive" }
},
"to": [ { "key_code": "vk_none" } ],
"to_after_key_up": [ { "set_variable": { "name": "variable_one",
"value": true
}
},
{ "set_variable": { "name": "variable_two",
"value": true
}
}
],
"type": "basic"
},
...
Alternatively, the following fragment works as all three variables appear under "Karabiner-EventViewer" >> "Variables" after Karabiner is (re-)started, both shift-keys are pressed, and Karabiner has had a chance to evaluate it. After this is evaluated, the original example also works on successive presses of both shift-keys:
...
{ "conditions": [ { "type": "variable_if",
"name": "variable_three",
"value": 0
}
],
"from": { "simultaneous": [ { "key_code": "left_shift" },
{ "key_code": "right_shift" }
],
"simultaneous_options": { "key_down_order": "insensitive" }
},
"to": [ { "key_code": "vk_none" } ],
"to_after_key_up": [ { "set_variable": { "name": "variable_one",
"value": true
}
},
{ "set_variable": { "name": "variable_two",
"value": true
}
},
{ "set_variable": { "name": "variable_three",
"value": 1
}
}
],
"type": "basic"
},
...
As above, if I've slipped off the beam at some point please point out where.