I found that I can remap several keys pressed at the same time: Karabiner-Elements complex manipulation: from.simultaneous
{
"type": "basic",
"from": {
"simultaneous": [
{
"key_code": "a"
},
{
"key_code": "s"
},
{
"key_code": "d"
}
],
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "mission_control"
}
]
}
But I want to always remap the fn to the right Shift, except when the F1, F2, etc. are also pressed.
That's because I want fn to be the right Shift, but still be able to use fn+F1, etc. as shortcuts to control brightness and volume. My original mapping
{
"type": "basic",
"from": {
"apple_vendor_top_case_key_code": "keyboard_fn"
},
"to": [
{
"key_code": "right_shift"
}
]
}
stops my system-wide brightness controls from working (I use fn + the function key to trigger the macOS binding instead of the app's binding).
My other workaround attempt was to map to both the right Shift and the function key at the same time:
"to": [
{
"apple_vendor_top_case_key_code": "keyboard_fn"
},
{
"key_code": "right_shift"
}
]
Unfortunately, only the right Shift gets detected. If I swap their positions in the list, then only the function key gets detected.