Skip to content

Instantly share code, notes, and snippets.

@su-thomas
Last active March 3, 2022 03:47
Show Gist options
  • Save su-thomas/841600e39d165d25401319b73f4fa4f9 to your computer and use it in GitHub Desktop.
Save su-thomas/841600e39d165d25401319b73f4fa4f9 to your computer and use it in GitHub Desktop.
macOS Karabiner Function Layer (number keys -> media/f keys)
{
"title": "Map number keys to function keys [su-thomas fork]",
"rules": [
{
"description": "Map ctrl + fn + number keys to their corresponding function keys",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "1",
"modifiers": {
"mandatory": [
"fn",
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f1"
}
]
},
{
"type": "basic",
"from": {
"key_code": "2",
"modifiers": {
"mandatory": [
"fn",
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f2"
}
]
},
{
"type": "basic",
"from": {
"key_code": "3",
"modifiers": {
"mandatory": [
"fn",
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f3"
}
]
},
{
"type": "basic",
"from": {
"key_code": "4",
"modifiers": {
"mandatory": [
"fn",
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f4"
}
]
},
{
"type": "basic",
"from": {
"key_code": "5",
"modifiers": {
"mandatory": [
"fn",
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f5"
}
]
},
{
"type": "basic",
"from": {
"key_code": "6",
"modifiers": {
"mandatory": [
"fn",
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f6"
}
]
},
{
"type": "basic",
"from": {
"key_code": "7",
"modifiers": {
"mandatory": [
"fn",
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f7"
}
]
},
{
"type": "basic",
"from": {
"key_code": "8",
"modifiers": {
"mandatory": [
"fn",
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f8"
}
]
},
{
"type": "basic",
"from": {
"key_code": "9",
"modifiers": {
"mandatory": [
"fn",
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f9"
}
]
},
{
"type": "basic",
"from": {
"key_code": "0",
"modifiers": {
"mandatory": [
"fn",
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f10"
}
]
},
{
"type": "basic",
"from": {
"key_code": "hyphen",
"modifiers": {
"mandatory": [
"fn",
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f11"
}
]
},
{
"type": "basic",
"from": {
"key_code": "equal_sign",
"modifiers": {
"mandatory": [
"fn",
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f12"
}
]
}
]
},
{
"description": "Map ctrl + number keys to their corresponding media control keys",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "1",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "display_brightness_decrement"
}
]
},
{
"type": "basic",
"from": {
"key_code": "2",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "display_brightness_increment"
}
]
},
{
"type": "basic",
"from": {
"key_code": "3",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "mission_control"
}
]
},
{
"type": "basic",
"from": {
"key_code": "4",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "launchpad"
}
]
},
{
"type": "basic",
"from": {
"key_code": "5",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "illumination_decrement"
}
]
},
{
"type": "basic",
"from": {
"key_code": "6",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "illumination_increment"
}
]
},
{
"type": "basic",
"from": {
"key_code": "7",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "rewind"
}
]
},
{
"type": "basic",
"from": {
"key_code": "8",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "play_or_pause"
}
]
},
{
"type": "basic",
"from": {
"key_code": "9",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "fastforward"
}
]
},
{
"type": "basic",
"from": {
"key_code": "0",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "mute"
}
]
},
{
"type": "basic",
"from": {
"key_code": "hyphen",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "volume_decrement"
}
]
},
{
"type": "basic",
"from": {
"key_code": "equal_sign",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "volume_increment"
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment