Skip to content

July 11, 2005

9

Swapping Modifier Keys Seperately on a Notebook and External Keyboard in Mac OSX Tiger

I finally upgraded to Tiger this weekend. It went painlessly, which is always a surprise to me. I feel like upgrading an OS is like a driver and passenger swapping places at 60 mph on deadman’s curve.

There has been plenty said about Apple finally including the ability to trivially swap modifier keys in the new Keyboard & Mouse Preference panel. As a result, it seems uControl development may cease. However, the common complaint from many users has been that they can not swap modifier keys on a per-keyboard basis. I use a external keyboard with my PowerBook when at my desk and need the command and option swapped on it, but not on my PowerBook. Here is my procedure for remedying this.

Note: This only works on older model PowerBooks and iBooks that used ADB keyboards. I do not have a solution for USB keyboard equipped PowerBooks. To find out if this will apply to you, run this command:

kextstat | grep com.apple.driver.AppleADBKeyboard

If you see a line that looks something like this:

57    0 0x2e3e8000 0x4000     0x3000     com.apple.driver.AppleADBKeyboard (2.3.8f2) <44 20 11>

Then your notebook is compatible with this hint.

The trick is to swap the the Command and Option keys for the built-in keyboard in the low-level keyboard driver and then use the Keyboard & Mouse Preference pane to swap them again. This results in the keys being swapped on both the external and the built-in keyboards.

I used the information on Heiko Hellweg’s site to do this.

Follow Heiko’s instructions as if you wanted to remap the ‘enter’ key and instead, or in addition to, when editing the ADBVirtualKeys plist key,
replace the one 0x37 with 0x3A and the following occurrence of 0x3A with 0x37.
This swaps Command and Option in the ADB driver.

As per Heiko’s instructions, delete the kernel extension caches and reboot.

Then you can go into the Keyboard & Mouse Preference pane and swap the modifier keys there. This should result in your external and built in keyboards having the correct arrangement of Command and Option.

I also had to edit all of my ControllerMate mouse button mappings to send Option instead of Command since the events sent by ControllerMate are still interpreted by the keyboard driver which now translates all Command presses into Option presses.

Read more from Technical
9 Comments Post a comment
  1. Jul 13 2005

    Oops, it looked like I didn’t do this quite right. Now neither my Control key nor the arrow keys (all four of them!) work.

    Could you mail me an unmodified copy if you have one? In my infinite wisdom, I didn’t make a backup of my ADBVirtualKeys plist.

  2. Jul 18 2005

    Any news on doing something similar with a USB-keyboard on Tiger?

  3. Conrad
    Jul 23 2005

    I can’t see any way to make this happen with a USB keyboard without using uControl. uControl should work for the time being if you have a USB keyboard built into your new PowerBook.

  4. Tim Terrill
    Jan 26 2006

    Hi,
    I spent a good 2 hours surfing to find someone who has solved this problem…I knew it wasn’t just me that would be annoyed by this…

    I followed your directions and it worked for me! Thanks for your efforts to document.

    My next problem to tackle…is there a documented way to map the unused keys (print screen, scroll lock, pause break) on a standard external USB keyboard (US) to something special (like volume up, down, mute)? I’m quite interested, and the uControl doesn’t work on my 10.4.4 Tiger installation.

    Thank you!

  5. Apr 4 2006

    I just wanted to say HUGE THANKS for posting this. Having to switch the way I user my command and option keys each time I go between my Powerbook keyboard and external MS keyboard was killing me!

  6. Apr 22 2006

    Beautiful!! This worked great for me. Thanks so much!

  7. vongani
    Jun 17 2008

    Hi there

    may you please help with my keyboard it has swapt @ with “. How do i restore to work in normal way.

  8. Conrad
    Jun 17 2008

    @vonagi,
    I’m not sure, but I don’t think there’s anyway to change that since they are shift-modified keys. How did this problem start in the first place for you?

Trackbacks & Pingbacks

  1. Swapping Modifier Keys Seperately on a Notebook and External Keyboard in Mac OSX Tiger (Update) « Graph Paper

Share your thoughts, post a comment.

(required)
(required)

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments