This is a follow up to How can I map the Windows key to option in Microsoft Remote Desktop version 8?. The answers to that question are a huge timesavers for OSX RDC users; however, there are some key combinations I don't want remapped. For example, Command+Q and Command+W would ideally still function the same as they do before remapping.
I tried adding this definition:
<autogen>
__KeyToKey__
KeyCode::Q, ModifierFlag::COMMAND_L,
KeyCode::Q, ModifierFlag::COMMAND_L
</autogen>
But to no effect.
Update: here is the full private.xml
:
<root>
<appdef>
<appname>Microsoft Remote Desktop</appname>
<equal>com.microsoft.rdc.mac</equal>
</appdef>
<item>
<name>Swap command and option in Remote Desktop</name>
<identifier>private.remotedesktopswapcommandandcontrol</identifier>
<only>Microsoft Remote Desktop</only>
<autogen>
__KeyToKey__
KeyCode::Q, ModifierFlag::COMMAND_L,
KeyCode::Q, ModifierFlag::COMMAND_L
</autogen>
<autogen>__KeyToKey__ KeyCode::TAB, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_OPTION, KeyCode::TAB, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ KeyCode::OPTION_L, KeyCode::COMMAND_L</autogen>
<autogen>__KeyToKey__ KeyCode::COMMAND_L, KeyCode::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::OPTION_R, KeyCode::COMMAND_R</autogen>
<autogen>__KeyToKey__ KeyCode::COMMAND_R, KeyCode::OPTION_R</autogen>
</item>
</root>
Best Answer
The documentation suggests that these shouldn't conflict:
However, the second
<autogen>
will override theCOMMAND_L
of the first. The solution is counterintuitive:In this case
Cmd+Q
is remapped toOpt+Q
but thenOpt+Q
is remapped back to `Cmd+Q'.