Skip to content

Instantly share code, notes, and snippets.

@Fadyio
Last active June 27, 2022 14:58
Show Gist options
  • Save Fadyio/da8b7aea38f63937d4e3a4af1d4ff4dc to your computer and use it in GitHub Desktop.
Save Fadyio/da8b7aea38f63937d4e3a4af1d4ff4dc to your computer and use it in GitHub Desktop.
Map caps lock to esc (if tapped) or control (if held down or combined with another key). Use with Karabiner Elements on MacOS
{
"title": "Change caps_lock to Esc and Control",
"rules": [
{
"description": "Post Esc if Caps is tapped, Control if held.",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_control",
"lazy": true
}
],
"to_if_alone": [
{
"key_code": "escape"
}
]
}
]
}
]
}
  1. Save file to ~/.config/karabiner/assets/complex_modifications/custom-capslock.json
  2. In GUI, add rule under complex modifications
  3. Change to_if_alone_timeout_milliseconds from 1000 to 500 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment