Skip to content

Instantly share code, notes, and snippets.

@DennyWeinberg
Last active September 5, 2024 08:34
Show Gist options
  • Save DennyWeinberg/2a6fa2dc12739134fe511aded8320e2a to your computer and use it in GitHub Desktop.
Save DennyWeinberg/2a6fa2dc12739134fe511aded8320e2a to your computer and use it in GitHub Desktop.
Karabiner Elements JSON configuration for an external keyboard (And RDP specific things)
{
"description": "Keyboards",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"com\\.microsoft\\.rdc\\.osx\\.beta",
"com\\.microsoft\\.rdc\\.macos"
],
"type": "frontmost_application_unless"
},
{
"identifiers": [
{
"description": "USB Keyboard",
"product_id": 1,
"vendor_id": 9610
}
],
"type": "device_if"
}
],
"description": "Home is jump left or select to start of line (Not for RDP)",
"from": {
"key_code": "home",
"modifiers": { "mandatory": ["shift"] }
},
"to": [
{
"key_code": "left_arrow",
"modifiers": ["command", "shift"]
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"com\\.microsoft\\.rdc\\.osx\\.beta",
"com\\.microsoft\\.rdc\\.macos"
],
"type": "frontmost_application_unless"
},
{
"identifiers": [
{
"description": "USB Keyboard",
"product_id": 1,
"vendor_id": 9610
}
],
"type": "device_if"
}
],
"description": "End is jump right or select to end of line (Not for RDP)",
"from": {
"key_code": "end",
"modifiers": { "mandatory": ["shift"] }
},
"to": [
{
"key_code": "right_arrow",
"modifiers": ["command", "shift"]
}
],
"type": "basic"
},
{
"conditions": [
{
"identifiers": [
{
"description": "USB Keyboard",
"product_id": 1,
"vendor_id": 9610
}
],
"type": "device_if"
},
{
"input_sources": [{ "input_source_id": "com.apple.keylayout.German-DIN-2137" }],
"type": "input_source_unless"
}
],
"description": "Space is switch to external keyboard input source",
"from": { "key_code": "spacebar" },
"to": [
{ "select_input_source": { "input_source_id": "com.apple.keylayout.German-DIN-2137" } },
{ "key_code": "spacebar" }
],
"type": "basic"
},
{
"conditions": [
{
"identifiers": [
{
"description": "Internal Keyboard",
"product_id": 1,
"vendor_id": 9610
}
],
"type": "device_unless"
},
{
"input_sources": [{ "input_source_id": "com.apple.keylayout.SwissGerman" }],
"type": "input_source_unless"
}
],
"description": "Space is switch to internal keyboard input source",
"from": { "key_code": "spacebar" },
"to": [
{ "select_input_source": { "input_source_id": "com.apple.keylayout.SwissGerman" } },
{ "key_code": "spacebar" }
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"com\\.microsoft\\.rdc\\.osx\\.beta",
"com\\.microsoft\\.rdc\\.macos"
],
"type": "frontmost_application_unless"
},
{
"identifiers": [
{
"description": "USB Keyboard",
"product_id": 1,
"vendor_id": 9610
}
],
"type": "device_if"
}
],
"description": "Home is jump left (Not for RDP)",
"from": { "key_code": "home" },
"to": [
{
"key_code": "left_arrow",
"modifiers": ["command"]
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"com\\.microsoft\\.rdc\\.osx\\.beta",
"com\\.microsoft\\.rdc\\.macos"
],
"type": "frontmost_application_unless"
},
{
"identifiers": [
{
"description": "USB Keyboard",
"product_id": 1,
"vendor_id": 9610
}
],
"type": "device_if"
}
],
"description": "End is jump left (Not for RDP)",
"from": { "key_code": "end" },
"to": [
{
"key_code": "right_arrow",
"modifiers": ["command"]
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"com\\.microsoft\\.rdc\\.osx\\.beta",
"com\\.microsoft\\.rdc\\.macos"
],
"type": "frontmost_application_unless"
},
{
"identifiers": [
{
"description": "USB Keyboard",
"product_id": 1,
"vendor_id": 9610
}
],
"type": "device_if"
}
],
"description": "CTRL is command (Not for RDP)",
"from": { "key_code": "left_control" },
"to": [{ "key_code": "left_command" }],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"com\\.microsoft\\.rdc\\.osx\\.beta",
"com\\.microsoft\\.rdc\\.macos"
],
"type": "frontmost_application_unless"
},
{
"identifiers": [
{
"description": "USB Keyboard",
"product_id": 1,
"vendor_id": 9610
}
],
"type": "device_if"
}
],
"description": "ALT+c is control+c (Not for RDP)",
"from": {
"key_code": "c",
"modifiers": { "mandatory": ["left_option"] }
},
"to": [
{
"key_code": "c",
"modifiers": ["left_control"]
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"com\\.microsoft\\.rdc\\.osx\\.beta",
"com\\.microsoft\\.rdc\\.macos"
],
"type": "frontmost_application_unless"
},
{
"identifiers": [
{
"description": "USB Keyboard",
"product_id": 1,
"vendor_id": 9610
}
],
"type": "device_if"
}
],
"description": "ALT+r is control+c (Not for RDP)",
"from": {
"key_code": "r",
"modifiers": { "mandatory": ["left_option"] }
},
"to": [
{
"key_code": "r",
"modifiers": ["left_control"]
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"com\\.microsoft\\.rdc\\.osx\\.beta",
"com\\.microsoft\\.rdc\\.macos"
],
"type": "frontmost_application_unless"
},
{
"identifiers": [
{
"description": "USB Keyboard",
"product_id": 1,
"vendor_id": 9610
}
],
"type": "device_if"
}
],
"description": "CTRL+Left Arrow is command (Not for RDP)",
"from": {
"key_code": "left_arrow",
"modifiers": {
"mandatory": ["left_command"],
"optional": ["shift"]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": ["left_option"]
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"com\\.microsoft\\.rdc\\.osx\\.beta",
"com\\.microsoft\\.rdc\\.macos"
],
"type": "frontmost_application_unless"
},
{
"identifiers": [
{
"description": "USB Keyboard",
"product_id": 1,
"vendor_id": 9610
}
],
"type": "device_if"
}
],
"description": "CTRL+Right Arrow is command (Not for RDP)",
"from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": ["left_command"],
"optional": ["shift"]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": ["left_option"]
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"com\\.microsoft\\.rdc\\.osx\\.beta",
"com\\.microsoft\\.rdc\\.macos"
],
"type": "frontmost_application_unless"
},
{
"identifiers": [
{
"description": "USB Keyboard",
"product_id": 1,
"vendor_id": 9610
}
],
"type": "device_if"
}
],
"description": "CTRL+Tab is CTRL+Tab (Not for RDP)",
"from": {
"key_code": "tab",
"modifiers": {
"mandatory": ["left_command"],
"optional": ["shift"]
}
},
"to": [
{
"key_code": "tab",
"modifiers": ["left_control"]
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"com\\.microsoft\\.rdc\\.osx\\.beta",
"com\\.microsoft\\.rdc\\.macos"
],
"type": "frontmost_application_unless"
},
{
"identifiers": [
{
"description": "USB Keyboard",
"product_id": 1,
"vendor_id": 9610
}
],
"type": "device_if"
}
],
"description": "Alt+Tab is option+Tab (Not for RDP)",
"from": {
"key_code": "tab",
"modifiers": { "mandatory": ["left_option"] }
},
"to": [
{
"key_code": "tab",
"modifiers": ["command"]
}
],
"type": "basic"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment