Skip to content

Instantly share code, notes, and snippets.

@moritzWa
Last active February 9, 2026 01:31
Show Gist options
  • Select an option

  • Save moritzWa/18405084bb09aa81ef7779217e0181b2 to your computer and use it in GitHub Desktop.

Select an option

Save moritzWa/18405084bb09aa81ef7779217e0181b2 to your computer and use it in GitHub Desktop.
Workaround: Chrome Cmd+Shift+T not working with custom keyboard layouts (ADNW/Neo2) + Karabiner

Karabiner-Elements rules for Deutsch (ADNW) keyboard layout on macOS

Fixes and ergonomic shortcuts for using the ADNW keyboard layout on macOS with Karabiner-Elements.

Problem

Custom keyboard layouts like ADNW define a command keymap that remaps keys when Cmd is held. This causes issues:

  • Chrome's Cmd+Shift+T (Reopen Closed Tab) breaks because keycode 17 maps to a-umlaut instead of t in ADNW's command keymap
  • Other shortcuts need remapping to match ADNW's ergonomic key positions

What's included

1. Chrome Cmd+Shift+T fix

Temporarily switches to US layout, sends the keystroke, then switches back. The layout switch is instant and invisible.

2. Ergonomic Cut/Copy/Paste

Maps to ADNW home row positions:

  • Cmd+I (ADNW position) -> Cut (Cmd+X)
  • Cmd+E (ADNW position) -> Copy (Cmd+C)
  • Cmd+A (ADNW position) -> Paste (Cmd+V)

3. Digit input via Cmd+Opt + home row

  • Cmd+Opt + home row keys -> digits 0-9
  • Mapping: t=4, r=5, n=6, g=7, c=8, l=9, m=3, w=2, p=1, space=0

4. Special character shortcuts

  • Opt+P -> %
  • Opt+Z -> ;

5. Navigation shortcuts

  • Cmd+R -> Previous tab (Opt+Cmd+Left)
  • Cmd+N -> Next tab (Opt+Cmd+Right)
  • Cmd+Fn+Left/Right -> Word jumping
  • Cmd+Shift+Fn+Left/Right -> Word selection
  • Cmd+A-umlaut -> Search selected word in new tab

Setup

  1. Save adnw_karabiner_rules.json to ~/.config/karabiner/assets/complex_modifications/
  2. Open Karabiner-Elements Settings -> Complex Modifications -> Add rule
  3. Enable the rules you want

Adapting for other layouts

  • Update the input_source_id conditions to match your layout's identifier
  • Adjust key_code values in from fields to match your physical key positions
  • Find your layout's input_source_id in Karabiner EventViewer -> Variables tab

Key technique: select_input_source

The core workaround for layout-related shortcut issues is temporarily switching to the US layout:

"to": [
  { "select_input_source": { "input_source_id": "^com\\.apple\\.keylayout\\.US$" } },
  { "key_code": "t", "modifiers": ["command", "shift"] },
  { "select_input_source": { "input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$" } }
]

This switch is instant and invisible to the user.

{
"title": "ADNW keyboard layout fixes and shortcuts for Karabiner-Elements",
"rules": [
{
"description": "Map Cmd+Shift+T (ADNW J position) to reopen closed tab in Chrome",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.google\\.Chrome$"
],
"type": "frontmost_application_if"
},
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"from": {
"key_code": "j",
"modifiers": {
"mandatory": [
"command",
"shift"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"select_input_source": {
"input_source_id": "^com\\.apple\\.keylayout\\.US$"
}
},
{
"key_code": "t",
"modifiers": [
"command",
"shift"
]
},
{
"select_input_source": {
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
}
],
"type": "basic"
}
]
},
{
"description": "ADNW ergonomic cut/copy/paste (Cmd+I=Cut, Cmd+E=Copy, Cmd+A=Paste)",
"manipulators": [
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+I (ADNW) -> Cut",
"from": {
"key_code": "s",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"select_input_source": {
"input_source_id": "^com\\.apple\\.keylayout\\.US$"
}
},
{
"key_code": "x",
"modifiers": [
"command"
]
},
{
"select_input_source": {
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+E (ADNW) -> Copy",
"from": {
"key_code": "d",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"select_input_source": {
"input_source_id": "^com\\.apple\\.keylayout\\.US$"
}
},
{
"key_code": "c",
"modifiers": [
"command"
]
},
{
"select_input_source": {
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+A (ADNW) -> Paste",
"from": {
"key_code": "f",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"select_input_source": {
"input_source_id": "^com\\.apple\\.keylayout\\.US$"
}
},
{
"key_code": "v",
"modifiers": [
"command"
]
},
{
"select_input_source": {
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
}
],
"type": "basic"
}
]
},
{
"description": "ADNW digit input (Cmd+Opt + home row keys -> 0-9)",
"manipulators": [
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+Opt+P (ADNW) -> 1",
"from": {
"key_code": "period",
"modifiers": {
"mandatory": [
"command",
"option"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "3"
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+Opt+W (ADNW) -> 2",
"from": {
"key_code": "comma",
"modifiers": {
"mandatory": [
"command",
"option"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "2"
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+Opt+T (ADNW) -> 4",
"from": {
"key_code": "j",
"modifiers": {
"mandatory": [
"command",
"option"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "4"
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+Opt+R (ADNW) -> 5",
"from": {
"key_code": "k",
"modifiers": {
"mandatory": [
"command",
"option"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "5"
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+Opt+N (ADNW) -> 6",
"from": {
"key_code": "l",
"modifiers": {
"mandatory": [
"command",
"option"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "6"
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+Opt+G (ADNW) -> 7",
"from": {
"key_code": "u",
"modifiers": {
"mandatory": [
"command",
"option"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "7"
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+Opt+C (ADNW) -> 8",
"from": {
"key_code": "i",
"modifiers": {
"mandatory": [
"command",
"option"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "8"
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+Opt+L (ADNW) -> 9",
"from": {
"key_code": "o",
"modifiers": {
"mandatory": [
"command",
"option"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "9"
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+Opt+Space -> 0",
"from": {
"key_code": "spacebar",
"modifiers": {
"mandatory": [
"command",
"option"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "0"
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+Opt+P (ADNW) -> 1",
"from": {
"key_code": "m",
"modifiers": {
"mandatory": [
"command",
"option"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "1"
}
],
"type": "basic"
}
]
},
{
"description": "ADNW special character shortcuts (Opt+P -> %, Opt+Z -> ;)",
"manipulators": [
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Opt+P (ADNW) -> %",
"from": {
"key_code": "m",
"modifiers": {
"mandatory": [
"option"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"select_input_source": {
"input_source_id": "^com\\.apple\\.keylayout\\.US$"
}
},
{
"key_code": "5",
"modifiers": [
"shift"
]
},
{
"select_input_source": {
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Opt+Z (ADNW) -> ;",
"from": {
"key_code": "slash",
"modifiers": {
"mandatory": [
"option"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"select_input_source": {
"input_source_id": "^com\\.apple\\.keylayout\\.US$"
}
},
{
"key_code": "semicolon"
},
{
"select_input_source": {
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
}
],
"type": "basic"
}
]
},
{
"description": "ADNW navigation (tab switching, word jumping, search word in new tab)",
"manipulators": [
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+R (ADNW) -> Left tab (Opt+Cmd+Left)",
"from": {
"key_code": "k",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"option",
"command"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+N (ADNW) -> Right tab (Opt+Cmd+Right)",
"from": {
"key_code": "l",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"option",
"command"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+Fn+Left -> Jump to prev word (Opt+Left)",
"from": {
"key_code": "left_arrow",
"modifiers": {
"mandatory": [
"command",
"fn"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"option"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+Fn+Right -> Jump to next word (Opt+Right)",
"from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": [
"command",
"fn"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"option"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+Shift+Fn+Left -> Select prev word (Opt+Shift+Left)",
"from": {
"key_code": "left_arrow",
"modifiers": {
"mandatory": [
"command",
"shift",
"fn"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"option",
"shift"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+Shift+Fn+Right -> Select next word (Opt+Shift+Right)",
"from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": [
"command",
"shift",
"fn"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"option",
"shift"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
],
"type": "input_source_if"
}
],
"description": "Cmd+\u00c4 (ADNW) -> Search Word in New Tab (copy, new tab, paste, enter)",
"from": {
"key_code": "t",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"select_input_source": {
"input_source_id": "^com\\.apple\\.keylayout\\.US$"
}
},
{
"key_code": "c",
"modifiers": [
"command"
]
},
{
"key_code": "t",
"modifiers": [
"command"
]
},
{
"key_code": "v",
"modifiers": [
"command"
]
},
{
"key_code": "return_or_enter"
},
{
"select_input_source": {
"input_source_id": "^org\\.unknown\\.keylayout\\.DeutschADNW$"
}
}
],
"type": "basic"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment