I just updated to version 12 and now the complex modification:
{
"from": {
"key_code": "semicolon",
"modifiers": {
"mandatory": [
"left_shift"
]
}
},
"to": [
{
"key_code": "semicolon",
"modifiers": [
"caps_lock"
]
}
],
"to_if_alone": [
{
"key_code": "caps_lock"
}
],
"type": "basic"
}
does not work anymore. On the Swiss keyboard the caps_lock + semicolon should output a capital 脰 but only a 枚 is generated. A key modification takes place, but somehow the caps_lock gets lost. This worked in the previous version.
I got the similar situation for binding capslock to emit capslock if press alone, and control if as a modifier.
FWIW, I did use Karabiner-EventViewer to monitor the events. In 11.6.0 I'll get two control events and one caps lock events when pressing alone. But in 12.0.1 I'll get two control events and two caps lock events. But still, caps lock doesn't actually work in 12.0.1.
Thank you for feedback.
Since v12.0.0, Karabiner-Elements's virtual keyboard acts like the real hardware keyboard.
Thus, macOS ignores the short press on caps lock.
We need to held down caps lock.
I added hold_down_milliseconds parameter in the v12.0.2.
Upgrade to the latest beta version.

Then use hold_down_milliseconds as follows.
{
"from": {
"key_code": "semicolon",
"modifiers": {
"mandatory": [
"left_shift"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "semicolon"
}
],
"to_if_alone": [
{
"key_code": "caps_lock",
"hold_down_milliseconds": 500
}
],
"type": "basic"
}
@tekezo Appreciate your blazing fast fixing. 12.0.2 works for me. Thank you! 鉂わ笍 馃挋 馃挌 馃挏 馃挍
Thank you very much for the very fast reply.
Unfortunately, the modified json-script with Version 12.0.2 does not work for me. If I press now left shift + semikolon, the caps_lock is turn on permanently.
I want to change: left_shift + semikolon to caps_lock + semikolon, without having the caps_lock turned on afterwards... The caps_lock must be pressed simultaneously with semikolon. It looks like that this is done now sequentially.
I changed held_down_milliseconds -> hold_down_milliseconds at v12.0.3.
(We can use both held_down_milliseconds and hold_down_milliseconds in json.)
@JB74
This json should work.
{
"from": {
"key_code": "semicolon",
"modifiers": {
"mandatory": [
"left_shift"
]
}
},
"to": [
{
"key_code": "caps_lock",
"held_down_milliseconds": 100
},
{
"key_code": "semicolon"
},
{
"key_code": "caps_lock",
"held_down_milliseconds": 100
}
],
"type": "basic"
}
@tekezo: Thank you very, very much. It works now.
Similar problem here. Was working before v12.
Updated to beta 12.0.5.
The following works for the hyperkey part but the caps_lock doesn't work anymore :
{
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_shift",
"modifiers": [
"left_command",
"left_control",
"left_option"
]
}
],
"to_if_alone": [
{
"key_code": "caps_lock",
"held_down_milliseconds": 500
}
],
"type": "basic"
}
Now three questions :
Thanks.
@maclm Your json works fine on my machine.
What's result on EventViewer when you press caps lock key?
Do I need to modify basic parameters (timeout, threshold, delay) from their default values ?
No, you don't need to modify basic parameters.
What is the correct caps_lock setting in System Preference for both internal keyboard and Karabiner virtual keyboard ? Should it be set to "no action" for every devices ?
No, you don't have to change the System Preferences > Keyboard > Modifiers.
@tekezo funny enough, it works this morning...
So, the output looks like this :
eventType:key_down code:0xe3 name:left_gui misc:
eventType:key_down code:0xe0 name:left_control misc:
eventType:key_down code:0xe2 name:left_alt misc:
eventType:key_down code:0xe1 name:left_shift misc:
eventType:key_up code:0xe1 name:left_shift misc:
eventType:key_up code:0xe0 name:left_control misc:
eventType:key_up code:0xe2 name:left_alt misc:
eventType:key_up code:0xe3 name:left_gui misc:
eventType:key_down code:0x39 name:caps_lock misc:
eventType:key_up code:0x39 name:caps_lock misc:
...with a delay before the last line appears.
I guess it is related to "held_down_milliseconds": 500.
Anyway, it works so my Mac and I are back on track now.
Thanks for your time.
Best regards.
Most helpful comment
Thank you for feedback.
Since v12.0.0, Karabiner-Elements's virtual keyboard acts like the real hardware keyboard.
Thus, macOS ignores the short press on caps lock.
We need to held down caps lock.
I added
hold_down_millisecondsparameter in the v12.0.2.Upgrade to the latest beta version.

Then use
hold_down_millisecondsas follows.