-
-
Notifications
You must be signed in to change notification settings - Fork 902
Open
Description
Setting a variable in a to action and unsetting it in to_if_held_down may cause the variable to never be set for low values of to_if_held_down_threshold_milliseconds.
Reproduction
- Add the following complex modification:
{
"description": "testtest",
"manipulators": [
{
"from": { "key_code": "q" },
"to": [
{
"set_variable": {
"name": "layer-q",
"value": 1
}
},
{
"set_variable": {
"name": "layer-q-start",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "layer-q",
"value": 0
}
},
{
"set_variable": {
"name": "layer-q-start",
"value": 0
}
}
],
"to_if_alone": [{ "key_code": "q" }],
"to_if_held_down": [
{
"set_variable": {
"name": "layer-q-start",
"value": 0
}
}
],
"type": "basic"
}
]
}- Set
to_if_held_down_threshold_millisecondsto 110 ms or lower. - Open Karabiner-EventViewer and the variables tab.
- Press and hold
q.
Observed behavior
(Not 100% reliable, decrease to_if_held_down_threshold_milliseconds to increase chances.)
You’ll see that layer-q gets set to 1 but layer-q-start remains at 0.
I have recorded my view as I continuously press q:
Screen.Recording.2026-02-20.at.07.01.15.mov
Most of the time, I trigger the bug.
Expected behavior
layer-q-start flashes to 1 for the duration of to_if_held_down_threshold_milliseconds.
Notes
- Increasing
to_if_held_down_threshold_millisecondsresolves this issue. - This behavior breaks my hold-tap layer causing it to lose keys during fast typing.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels