How do I make Mac OS X remember "Modifier Keys" remappings for my external keyboard?

(to be clear, I know there are similar questions such as "How can I remap windows and alt keys in OS X?" - I'm not asking that. I can make the changes I want, they just get reset every time I unplug the keyboard)

So: Mac OS 10.6.5 on a MacBook Pro, with a Microsoft Natural Ergonomic Keyboard 4000 plugged in via a USB hub, along with other peripherals.

I want to switch the Alt and Windows keys, so their positions match that on the MBP's keyboard (Win key works as Command key with the Mac).

Sys Prefs / Keyboard / Modifier Keys does the job, until I unplug things to work elsewhere. Come back, plug the USB hub in as before, and my Option/Command swap has been forgotten.

Any suggestions as to how to get Mac OS to remember the swap?

Update:

The problem has vanished for me under OS X Lion. Same hardware, same hub, all of the modifiers are remembered.


Solution 1:

This appears to be an issue for a lot of people, including me. The apple support forums seem to have the same conclusion that this is some kind of bug with Mac OS X and usb hubs:

https://discussions.apple.com/thread/2364069?threadID=2364069&tstart=0

Their suggestion is to plug the keyboard in directly to the Mac.

I've starting using KeyRemap4MacBook to deal with this issue. What you can do is tell it to remap command to option and option to command for ONLY external keyboards and any non apple external device.