Skip to content

Instantly share code, notes, and snippets.

@drmohundro
Last active September 21, 2017 00:36
Show Gist options
  • Save drmohundro/0c9236430e4d201b5aff to your computer and use it in GitHub Desktop.
Save drmohundro/0c9236430e4d201b5aff to your computer and use it in GitHub Desktop.
Karabiner private.xml to swap option and command keys for Parallels
<?xml version="1.0"?>
<root>
<appdef>
<appname>PARALLELS</appname>
<equal>com.parallels.desktop.console</equal>
</appdef>
<devicevendordef>
<vendorname>MICROSOFT</vendorname>
<vendorid>0x045e</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>MICROSOFT_ERGONOMIC_KEYBOARD</productname>
<productid>0x00db</productid>
</deviceproductdef>
<item>
<name>Swap Command and Option (Parallels)</name>
<identifier>private.app_parallels_swap_command_and_option</identifier>
<only>PARALLELS</only>
<device_only>DeviceVendor::MICROSOFT, DeviceProduct::MICROSOFT_ERGONOMIC_KEYBOARD</device_only>
<autogen>__KeyToKey__ KeyCode::OPTION_L, KeyCode::COMMAND_L</autogen>
<autogen>__KeyToKey__ KeyCode::COMMAND_L, KeyCode::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::COMMAND_R, KeyCode::OPTION_L</autogen>
</item>
</root>
@drmohundro
Copy link
Author

@NicolasVanhecke my apologies, but I never was notified of your comment, otherwise I would have tried to respond!

I'm not sure off hand what might be going on with your problem, but I will say that, if you're on MacOS Sierra, Karabiner doesn't work any more and you'd need Karabiner Elements instead. That's actually what I'm using now and it has a GUI for mapping keys per device (which is a relatively new feature). It's a lot easier than messing with the private.xml file.

@drmohundro
Copy link
Author

Regarding notifications... oh. This is why - isaacs/github#21. 🤦‍♂️

@drmohundro
Copy link
Author

See latest Karabiner Elements support to give me all of these options at https://github.com/drmohundro/dotfiles/blob/master/config/karabiner/karabiner.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment