Skip to content

Instantly share code, notes, and snippets.

@JonTheNiceGuy
Last active April 17, 2026 13:56
Show Gist options
  • Select an option

  • Save JonTheNiceGuy/a15514656d0bb04245e39d0853914d20 to your computer and use it in GitHub Desktop.

Select an option

Save JonTheNiceGuy/a15514656d0bb04245e39d0853914d20 to your computer and use it in GitHub Desktop.
Karabiner for OS X Keyboard Remapping

Karabiner for OS X Keyboard Remapping

This file should be imported into Karabiner, probably via the "Karabiner Complex Rules Generator".

This remaps the following keys:

` | " @ # ~ \ |

This is done with a single rule, and probably should be written in such a way that each is an individual rule!

{
"global": { "show_additional_menu_items": true },
"profiles": [
{
"complex_modifications": {
"rules": [
{
"description": "Remap Mac UK Keys to Windows UK ISO Layout",
"manipulators": [
{
"description": "Swap 'Shift + 2' with 'Shift + Quote' (@ and \")",
"from": {
"key_code": "2",
"modifiers": {
"mandatory": ["shift"],
"optional": ["caps_lock"]
}
},
"to": [
{
"key_code": "quote",
"modifiers": ["left_shift"]
}
],
"type": "basic"
},
{
"description": "Swap 'Shift + Quote' with 'Shift + 2' (\" and @)",
"from": {
"key_code": "quote",
"modifiers": {
"mandatory": ["shift"],
"optional": ["caps_lock"]
}
},
"to": [
{
"key_code": "2",
"modifiers": ["left_shift"]
}
],
"type": "basic"
},
{
"description": "Top-Left Key (§/±) -> ` (unshifted)",
"from": { "key_code": "grave_accent_and_tilde" },
"to": [{ "key_code": "non_us_backslash" }],
"type": "basic"
},
{
"description": "Top-Left Key (§/±) -> ¬ (shifted)",
"from": {
"key_code": "grave_accent_and_tilde",
"modifiers": {
"mandatory": ["shift"],
"optional": ["caps_lock"]
}
},
"to": [
{
"key_code": "l",
"modifiers": ["left_option"]
}
],
"type": "basic"
},
{
"description": "Bottom-Left Key (`/~) -> \\/|",
"from": { "key_code": "non_us_backslash" },
"to": [{ "key_code": "backslash" }],
"type": "basic"
},
{
"from": {
"key_code": "non_us_backslash",
"modifiers": {
"mandatory": ["shift"],
"optional": ["caps_lock"]
}
},
"to": [
{
"key_code": "backslash",
"modifiers": ["left_shift"]
}
],
"type": "basic"
},
{
"description": "Middle-Row Key (\\/|) -> #/~",
"from": { "key_code": "backslash" },
"to": [
{
"key_code": "3",
"modifiers": ["left_option"]
}
],
"type": "basic"
},
{
"from": {
"key_code": "backslash",
"modifiers": {
"mandatory": ["shift"],
"optional": ["caps_lock"]
}
},
"to": [
{
"key_code": "non_us_backslash",
"modifiers": ["left_shift"]
}
],
"type": "basic"
}
]
}
]
},
"devices": [
{
"identifiers": {
"is_keyboard": true,
"product_id": 1027,
"vendor_id": 4176
},
"ignore": false
},
{
"identifiers": {
"is_keyboard": true,
"product_id": 1031,
"vendor_id": 4176
},
"ignore": false
},
{
"identifiers": {
"is_keyboard": true,
"product_id": 1047,
"vendor_id": 6473
},
"ignore": true
},
{
"identifiers": {
"is_keyboard": true,
"product_id": 641,
"vendor_id": 1452
},
"simple_modifications": [
{
"from": { "apple_vendor_top_case_key_code": "keyboard_fn" },
"to": [{ "apple_vendor_top_case_key_code": "keyboard_fn" }]
},
{
"from": { "key_code": "left_command" },
"to": [{ "key_code": "left_command" }]
},
{
"from": { "key_code": "left_control" },
"to": [{ "key_code": "left_control" }]
},
{
"from": { "key_code": "left_option" },
"to": [{ "key_code": "left_option" }]
},
{
"from": { "key_code": "left_shift" },
"to": [{ "key_code": "left_shift" }]
},
{
"from": { "key_code": "right_command" },
"to": [{ "key_code": "right_command" }]
},
{
"from": { "key_code": "right_control" },
"to": [{ "key_code": "right_control" }]
},
{
"from": { "key_code": "right_option" },
"to": [{ "key_code": "right_option" }]
},
{
"from": { "key_code": "right_shift" },
"to": [{ "key_code": "right_shift" }]
}
]
}
],
"name": "Default",
"selected": true,
"simple_modifications": [
{
"from": { "key_code": "left_command" },
"to": [{ "key_code": "left_option" }]
},
{
"from": { "key_code": "left_option" },
"to": [{ "key_code": "left_command" }]
},
{
"from": { "key_code": "right_command" },
"to": [{ "key_code": "right_option" }]
},
{
"from": { "key_code": "right_control" },
"to": [{ "key_code": "fn" }]
},
{
"from": { "key_code": "right_option" },
"to": [{ "key_code": "right_command" }]
}
],
"virtual_hid_keyboard": {
"country_code": 0,
"keyboard_type_v2": "iso"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment