Remote Desktop Connection for MacOS - How to Remap Cmd/Opt keys

Daniel Carmingham 31 Reputation points
2021-06-23T01:18:02.923+00:00

Is there any way to remap keys on the MacOS version of Remote Desktop?

The mapping of the Command and Option keys to the Windows keyboard layout is backwards to every US keyboard layout I can find. (For example, on Apple and Microsoft's own websites at the keyboards they make and sell)

On a Mac keyboard the keys to the left of the spacebar, in order from left-to-right are:

  1. Control
  2. Option
  3. Command

On Windows keyboards/laptops, they are:

  1. Ctrl
  2. Win
  3. Alt

So it would make sense to map in that order, from left to right, wouldn't it?

  1. Control -> Ctrl
  2. Option -> Win
  3. Command -> Alt

Instead, what we have is that the first makes sense, but for some reason these last two are swapped:

  1. Control -> Ctrl
  2. Option -> Alt
  3. Command -> Win

This means that if you, like me, switch between Mac and Windows and RDC from Mac to Windows, the muscle memory is all wrong and you will constantly hit the wrong keys.

This is incredibly frustrating. Is there any way at all to reverse these two keys? I don't need full mapping, just these two keys need to be reversed.

Thank you,
Daniel

Remote Desktop
Remote Desktop
A Microsoft app that connects remotely to computers and to virtual apps and desktops.
4,252 questions
0 comments No comments
{count} vote

Accepted answer
  1. Jenny Yan-MSFT 9,326 Reputation points
    2021-06-23T07:36:57.907+00:00

    Hi,
    Mac keyboard layouts differ from the Windows keyboard layouts. Some of these are Mac specific layouts or custom layouts for which an exact match may not be available on the version of Windows you are remoting into.

    Following are examples for Mac keyboard layouts differ from the Windows keyboard layouts

    • The Command key on the Mac keyboard equals the Windows key.
    • To perform actions that use the Command button on the Mac, you will need to use the control button in Windows (for example Copy = Ctrl+C).
    • The function keys can be activated in the session by pressing additionally the FN key (for example, FN+F1).
    • The Alt key to the right of the space bar on the Mac keyboard equals the Alt Gr/right Alt key in Windows.

    However per further searching, some users shared their experience to map the keyboard like usage of “third party app Karabiner” to customize the keyboard layout.
    https://karabiner-elements.pqrs.org/

    Reference links:
    How would I remap Mac CMD to CTRL keys in Remote Desktop Connection for Mac application?
    https://superuser.com/questions/263647/how-would-i-remap-mac-cmd-to-ctrl-keys-in-remote-desktop-connection-for-mac-appl
    Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.

     

    Hope this helps and please help to accept as Answer if the response is useful.

    Thanks,
    Jenny

    0 comments No comments

9 additional answers

Sort by: Most helpful
  1. sarthak agarwal 1 Reputation point
    2021-10-02T03:37:37.237+00:00

    Hi Daniel,

    I am facing a similar problem, can you please share your karabiner config to achieve switching the last 2 keys?

    0 comments No comments

  2. Shooby T 1 Reputation point
    2021-12-06T03:46:33.187+00:00

    I went the Karabiner route. After just a couple of days I can say that this is not an adequate solution, all it does is swap the problems for different problems.

    Karabiner is like swatting flies with a sledgehammer. It looks at what app is in the foreground, and based on that, either remaps keystrokes for all windows and applications, or doesn't. There is no middle ground

    For instance, if you remap the ctrl key to cmd for RDC, then when RDC is in the foreground—even when you're not logged into a remote computer—you lose the ability to bring up Spotlight with cmd-Space, you have to remember to use ctrl-Space instead, only when RDC is in the foreground, which is no better than having to remember to switch to using ctrl instead of cmd for RDC sessions. You also completely lose the convenient ability to flip back and forth between fullscreen windows with ctrl-leftarrow and ctrl-rightarrow, something I do all the time, and can only leave a fullscreen RDC window by minimizing it from the title bar, so if you flip back and forth between a fullscreen remote connection and local mac apps a lot, suddenly it's nowhere near as easy. There is no workaround in this case, cmd-leftarrow and cmd-rightarrow don't work either. This system-wide shortcut stops being available until you bring some other app besides RDC into the foreground.

    I know the question was about swapping Command with Option, not Control, but the central issue still stands. System-wide keyboard shortcuts changing or being completely disabled depending on what app's window happens to be in the foreground is just as inconvenient as the problem supposed to solve.

    We need RDC to actually map local Command key to the remote Control key, for the remote computer ONLY, not globally changing local key mappings and disabling local native Mac system-wide functions to do it, even if there isn't a remote connection open, as Karabiner does.

    @sarthak agarwal , you need to edit the karabiner.json file at ~/.config/karabiner.json to create the changes you want. (Since I remapped Ctrl and Cmd instead of Opt and Cmd, I'm not sure exactly what code changes you'll need, you'll have to look it up in Karabiner's documentation.)

    BTW @Jenny Yan-MSFT , the link you provided to Uservoice is broken. There is no Remotedesktop forum there.


  3. Dan Mundy 0 Reputation points
    2023-01-20T00:21:08.9466667+00:00

    Anyone else struggling with this may want to check out the setting I just found in the Preferences for Microsoft Remote Desktop application:

    "Use Mac shortcuts for copy, cut, paste and select all, undo, and find"

    It doesn't completely swap Command and Windows keys, but does at least stop the constant frustration of Command-V not working :)

    0 comments No comments

  4. robotlearn 0 Reputation points
    2023-06-05T01:23:22.44+00:00

    +1 for the original poster.

    If you plug an Apple keyboard into a Windows PC, the CTRL key will act as 'CTRL' and CMD will act as WINKEY.

    This is absolutely what should happen in the macOS RDP client. At the very least, there should be an easy way to toggle the silly 'swapping' OFF.

    I am a programmer who regularly switches between macs and PCs, often several times a day. I have my mac(s) set up so that CTRL and CMD are swapped, so I can use both OSs and copy/paste correctly.

    But now if I RDP into Windows from a Mac, The CTRL key doesn't act as 'CTRL' in WINDOWS - which makes absolutely no sense, and it's insanely frustrating.

    0 comments No comments