Skip to content

Instantly share code, notes, and snippets.

@sloanlance
Last active December 21, 2017 17:10
Show Gist options
  • Save sloanlance/e97722a69b4752efe9d77425d66006dd to your computer and use it in GitHub Desktop.
Save sloanlance/e97722a69b4752efe9d77425d66006dd to your computer and use it in GitHub Desktop.
Karabiner: Require fn modifier key to activate esc key. Useful for preventing accidental esc keypresses on Macs with a Touch Bar. Doesn't affect all other modifier combinations (i.e., option + command + esc works without requiring fn, too).

Karabiner: Require fn modifier key to activate esc key

This complex modification rule for Karabiner-Elements will require fn modifier key to activate esc key. Useful for preventing accidental esc keypresses on Macs with a Touch Bar. Doesn't affect all other modifier combinations (i.e., option + command + esc works without requiring fn, too).

Import

To import this "complex modification" rule into Karabiner-Elements, use the command:

open karabiner://karabiner/assets/complex_modifications/import?url=https://gist.githubusercontent.com/sloanlance/e97722a69b4752efe9d77425d66006dd/raw/karabiner_require_fn_for_esc.json
Please see the README.md file in this gist.
{
"title": "Require fn for esc",
"rules": [
{
"description": "Require fn modifier key to activate esc key. Useful for preventing accidental esc keypresses on Macs with a Touch Bar. Doesn't affect all other modifier combinations (i.e., option + command + esc works without requiring fn, too). -- [email protected]",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape"
},
"to": [
{
"key_code": "vk_none"
}
]
},
{
"type": "basic",
"from": {
"key_code": "escape",
"modifiers": {
"mandatory": [
"fn"
]
}
},
"to": [
{
"key_code": "escape"
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment