Skip to content

Instantly share code, notes, and snippets.

@code4break
Last active August 11, 2021 09:47
Show Gist options
  • Save code4break/8ed7a034b5c2804155d0ad90036eba1c to your computer and use it in GitHub Desktop.
Save code4break/8ed7a034b5c2804155d0ad90036eba1c to your computer and use it in GitHub Desktop.
Microsoft Remote Desktop Client: on-board keyboard mapping for macOS | OS X (without karabiner) -> see README.md for details.

Getting started

Simple keyboard mapping for macOS users of the Microsoft Remote Desktop.app with no need of external programms like karabiner.

Default mappings:

Action macOS Windows From
Select all CMD + A CTRL + A Microsoft
Copy selected CMD + C CTRL + C Microsoft
Find string CMD + F CTRL + F Microsoft
Paste from clipboard CMD + V CTRL + V Microsoft
Cut selected CMD + X CTRL + X Microsoft
Undo CMD + Z CTRL + Z Microsoft
Redo CMD + Shift + Z CTRL + Shift + Z Additional
Save CMD + S CTRL + S Additional

Hint: Users with a non US keyboard may have to switch some keys. For example German keyboards have to replace Z with Y. If you use Dvorak instead of QWERTY you can also set layout name to <layout name="com.apple.keylayout.Dvorak">.

Download here: https://apps.apple.com/de/app/microsoft-remote-desktop/id1295203466

1. Change keyboard mode

Make sure that the keyboard mode is set to unicode. Go to menu and activate Connections > Keyboard Mode > Unicode.

2. Replace config file

Path to file: Applications > Microsoft Remote Desktop.app > Contents > Resources > Keyboard > ClipboardActionTransformations.xml

3. Add your own key shortcuts

You can add more shortcuts if you want. For example add the transform tag below to tranformations tag inside the default layout. This will open a print diaglog in common programs.

<?xml version="1.0" encoding="utf-8" ?>
<!-- transformation for clipboard actions (cut copy paste) -->
<!-- layout specific -->
<layouts>
    <!-- the default is US keyboard physical position for X C V -->
    <layout name="default">
        <transformations>
            
            ...
            
            <!-- Command+P to Control+P -->
            <transform>
                <from command="1" key="P" />
                <to control="1" key="P" />
            </transform>
            
            ...
            
        </transformations>
    </layout>
</layouts>

Hint: Besides command and control, shift is also available. Set shift="1" in a from or to tag.

<?xml version="1.0" encoding="utf-8" ?>
<!-- transformation for clipboard actions (cut copy paste) -->
<!-- layout specific -->
<layouts>
<!-- the default is US keyboard physical position for X C V -->
<layout name="default">
<transformations>
<!-- Command+A to Control+A -->
<transform>
<from command="1" key="A" />
<to control="1" key="A" />
</transform>
<!-- Command+C to Control+C -->
<transform>
<from command="1" key="C" />
<to control="1" key="C" />
</transform>
<!-- Command+F to Control+F -->
<transform>
<from command="1" key="F" />
<to control="1" key="F" />
</transform>
<!-- Command+V to Control+V -->
<transform>
<from command="1" key="V" />
<to control="1" key="V" />
</transform>
<!-- Command+X to Control+X -->
<transform>
<from command="1" key="X" />
<to control="1" key="X" />
</transform>
<!-- Command+Z to Control+Z -->
<transform>
<from command="1" key="Z" />
<to control="1" key="Z" />
</transform>
<!-- Command+Shift+Z to Control+Shift+Z (added) -->
<transform>
<from command="1" shift="1" key="Z" />
<to control="1" shift="1" key="Z" />
</transform>
<!-- Command+S to Control+S (added) -->
<transform>
<from command="1" key="S" />
<to control="1" key="S" />
</transform>
</transformations>
</layout>
</layouts>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment