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 0×37 with 0x3A and the following occurrence of 0x3A with 0×37.
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.