Multiple logitech keyboards with different keymaps

keyboardtext inputusb

I have this at work — http://www.logitech.com/en-us/product/wireless-solar-keyboard-k750-mac

and this at home — http://www.logitech.com/en-us/product/k750-keyboard?crid=26&section=features

Every time I switch between the two work-zones I have to remap my keyboards via Settings > Keyboard > Modifier Keys (basically I have to switch the windows and alt keys on the windows one)

Is there a way to avoid this annoyance, or at least reduce it to a simple click switch?

It's especially difficult I think because of the fact that they use the same type of wireless USB receiver.

Best Answer

You can use KeyRemap4MacBook to add settings for specific devices. EventViewer.app shows the vendor and product IDs.

<?xml version="1.0"?>
<root>
  <devicevendordef>
    <vendorname>HEWLETT_PACKARD</vendorname>
    <vendorid>0x03f0</vendorid>
  </devicevendordef>
  <deviceproductdef>
    <productname>MY_HP_KEYBOARD</productname>
    <productid>0x0224</productid>
  </deviceproductdef>
  <item>
    <name>test</name>
    <identifier>private.test</identifier>
    <device_only>DeviceVendor::HEWLETT_PACKARD, DeviceProduct::MY_HP_KEYBOARD</device_only>
    <autogen>__KeyToKey__ KeyCode::OPTION_L, KeyCode::COMMAND_L</autogen>
    <autogen>__KeyToKey__ KeyCode::OPTION_R, KeyCode::COMMAND_R</autogen>
    <autogen>__KeyToKey__ KeyCode::COMMAND_L, KeyCode::OPTION_L</autogen>
    <autogen>__KeyToKey__ KeyCode::COMMAND_R, KeyCode::OPTION_R</autogen>
  </item>
</root>

See the source for the key code values and predefined settings.