20

I have an external keyboard with Windows keys. I'd like to remap the keys so the layout of the keys on the bottom-left is identical to the internal keyboard on my MacBook Pro.

This...

ctrlfnwindowsaltspacebar

...should be this:

fncontroloptioncommandspacebar

I've succeeded in remapping the windows and alt keys to option and command, respectively, via the Keyboard pane in System Preferences, but switching the control and fn keys isn't possible that way. Does anyone know of a way to do this?


Note: I don't want to globally switch control and fn; I only want to switch them on the external keyboard. KeyRemap4MacBook only seems to be able to remap the internal keyboard. When I check "Don't remap internal keyboards," the internal layout is restored, but nothing changes on the external keyboard.

2
  • Were you able to figure this out?
    – Will Hua
    May 27, 2016 at 19:30
  • No, I've had no luck :/
    – Will
    May 27, 2016 at 23:14

3 Answers 3

12

Now you do not need any additional software. In System -> Keyboard -> Modifier keys you can remap separately each keyboard.

5

KeyRemap4MacBook also supports device-specific settings:

<?xml version="1.0"?>
<root>
  <devicevendordef>
    <vendorname>KINESIS</vendorname>
    <vendorid>0x05f3</vendorid>
  </devicevendordef>
  <deviceproductdef>
    <productname>ADVANTAGE</productname>
    <productid>0x0007</productid>
  </deviceproductdef>
  <item>
    <name>modifierkeys</name>
    <identifier>modifierkeys</identifier>
    <device_only>DeviceVendor::KINESIS, DeviceProduct::ADVANTAGE</device_only>
    <autogen>__KeyToKey__ KeyCode::CONTROL_L, KeyCode::FN</autogen>
    <autogen>__KeyToKey__ KeyCode::FN, KeyCode::CONTROL_L</autogen>
    <autogen>__KeyToKey__ KeyCode::COMMAND_L, KeyCode::OPTION_L</autogen>
    <autogen>__KeyToKey__ KeyCode::OPTION_L, KeyCode::COMMAND_L</autogen>
  </item>
</root>

You can see the vendor and product IDs from EventViewer.app. If it can't remap any keys on the external keyboard, try uninstalling other keyboard or HID drivers.

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

1
  • EventViewer is a helper application inside KeyRemap. We can also check vendor and device IDs inside System Information. EventViewer also shows the actual keycodes that we're typing.
    – brasofilo
    Feb 25, 2017 at 10:50
-1

You can indeed use System Preferences as Marcin indicated. If you want more fine grained control KeyRemap is for older macOSs up to 10.8. After that the same author has created Karabiner. See his website.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .