Karabiner-Elements
Karabiner-Elements copied to clipboard
`variable_if` not working for `name`s with `-`
The following will correctly launch Mission Control upon clicking right shift twice:
[
{
"type": "basic",
"from": {
"key_code": "right_shift",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "mission_control"
}
],
"conditions": [
{
"type": "variable_if",
"name": "key sequence",
"value": "[right_shift]"
}
]
},
{
"type": "basic",
"from": {
"key_code": "right_shift",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"set_variable": {
"name": "key sequence",
"value": "[right_shift]"
}
},
{
"key_code": "right_shift"
}
],
"to_delayed_action": {
"to_if_invoked": [
{
"set_variable": {
"name": "key sequence",
"value": "[]"
}
}
],
"to_if_canceled": [
{
"set_variable": {
"name": "key sequence",
"value": "[]"
}
}
]
}
}
]
But the following incorrectly launches Mission Control on a single click of right shift:
[
{
"type": "basic",
"from": {
"key_code": "right_shift",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "mission_control"
}
],
"conditions": [
{
"type": "variable_if",
"name": "key-sequence",
"value": "[right_shift]"
}
]
},
{
"type": "basic",
"from": {
"key_code": "right_shift",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"set_variable": {
"name": "key-sequence",
"value": "[right_shift]"
}
},
{
"key_code": "right_shift"
}
],
"to_delayed_action": {
"to_if_invoked": [
{
"set_variable": {
"name": "key-sequence",
"value": "[]"
}
}
],
"to_if_canceled": [
{
"set_variable": {
"name": "key-sequence",
"value": "[]"
}
}
]
}
}
]