Skip to content

Instantly share code, notes, and snippets.

@ChuckJonas
Last active July 30, 2024 13:12
Show Gist options
  • Save ChuckJonas/92a59284b91a3acd064fc58e0dc6333d to your computer and use it in GitHub Desktop.
Save ChuckJonas/92a59284b91a3acd064fc58e0dc6333d to your computer and use it in GitHub Desktop.
Karabiner Elements for OSX keybindings in RDP

setup

  1. Install & run Karabiner-Elements
  2. Navigate to misc-> open config folder
  3. Copy the above rules.json file to the complex_modifications folder
  4. Navigate to Complex Modifications -> Enable Rules
  5. Enable all of the above rules
  6. Under devices enable your keyboard
{
"title": "Mac OSX Style Shortcuts for RDP sessions. Translates OSX shortcuts to PC equivalent",
"maintainers": [
"charlie"
],
"rules": [
{
"description": "Swap command and control",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"com\\.microsoft\\.rdc\\.mac"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "left_control",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_command"
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"com\\.microsoft\\.rdc\\.mac"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "left_command",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_control"
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"com\\.microsoft\\.rdc\\.mac"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "right_control",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_command"
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"com\\.microsoft\\.rdc\\.mac"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "right_command",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_control"
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Home key to the beginning of the sentence (Command + Left)",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "left_arrow",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "home"
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: End key to the end of the sentence (Command + Right)",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": [
"control"
],
"optional": [
"shift"
]
}
},
"parameters": {
"basic.simultaneous_threshold_milliseconds": 500
},
"to": [
{
"key_code": "end"
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Option(Alt)+Tab as Switch Application (Command+Tab)",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "tab",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "tab",
"modifiers": [
"option"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Copy/Paste/Cut",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "c",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": [
{
"key_code": "c",
"modifiers": [
"control"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "v",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": [
{
"key_code": "v",
"modifiers": [
"control"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "x",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": [
{
"key_code": "x",
"modifiers": [
"control"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Alt+Left/Right to Control+Left/Right",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "left_arrow",
"modifiers": {
"mandatory": [
"left_option"
],
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"control"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": [
"left_option"
],
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"control"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Undo",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "z",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": [
{
"key_code": "z",
"modifiers": [
"control"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Redo",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "z",
"modifiers": {
"mandatory": [
"command",
"shift"
]
}
},
"to": [
{
"key_code": "z",
"modifiers": [
"left_control",
"left_shift"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Select-All",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "a",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": [
{
"key_code": "a",
"modifiers": [
"control"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Save",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "s",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": [
{
"key_code": "s",
"modifiers": [
"control"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: New",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "n",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": [
{
"key_code": "n",
"modifiers": [
"control"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Reload browser page Command+R to F5",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"simultaneous": [
{
"key_code": "left_command"
},
{
"key_code": "r"
}
]
},
"parameters": {
"basic.simultaneous_threshold_milliseconds": 500
},
"to": [
{
"key_code": "f5"
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "r",
"modifiers": {
"mandatory": [
"command",
"shift"
]
}
},
"to": [
{
"key_code": "f5",
"modifiers": [
"left_control"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: New Tab",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "t",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": [
{
"key_code": "t",
"modifiers": [
"control"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Find",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "f",
"modifiers": {
"mandatory": [
"left_command"
]
}
},
"to": [
{
"key_code": "f",
"modifiers": [
"control"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Open",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "o",
"modifiers": {
"mandatory": [
"left_command"
]
}
},
"to": [
{
"key_code": "o",
"modifiers": [
"control"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Close Window",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "w",
"modifiers": {
"mandatory": [
"left_command"
]
}
},
"to": [
{
"key_code": "w",
"modifiers": [
"control"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Fn+Space To Switch Input (Left Shift+Left Alt)",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "spacebar",
"modifiers": {
"mandatory": [
"fn"
]
}
},
"to": [
{
"key_code": "left_shift",
"modifiers": [
"left_option"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Cmd+Space To Switch Input (Left Shift+Left Alt)",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "spacebar",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": [
{
"key_code": "left_shift",
"modifiers": [
"left_option"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Cmd+Space To Switch Input (Left Shift+Left Ctrl)",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "spacebar",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": [
{
"key_code": "left_shift",
"modifiers": [
"left_control"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Quit Application (Alt+F4 to Command+Q)",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "q",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": [
{
"key_code": "f4",
"modifiers": [
"option"
]
}
],
"type": "basic"
}
]
},
{
"description": "Mac OSX RDP: Browser open location (Ctrl+L)",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.microsoft\\.rdc$",
"^com\\.microsoft\\.rdc\\.mac$",
"^com\\.microsoft\\.rdc\\.macos$",
"^com\\.microsoft\\.rdc\\.osx\\.beta$",
"^com\\.thinomenon\\.RemoteDesktopConnection$",
"^com\\.teamviewer\\.TeamViewer$",
"^com\\.vmware\\.horizon$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "l",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": [
{
"key_code": "l",
"modifiers": [
"control"
]
}
],
"type": "basic"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment