
You may recall that one of Apple's slogans when the Mac mini was released was BYOKM-bring your own keyboard and mouse. Well a lot of those keyboards will of course be Windows keyboards, and while they work fine on a Mac, there's one particularly annoying thing. For some reason the keyboard Windows key is mapped to the Mac Command key and the keyboard Alt key is mapped to the Mac Alt or option key. The reason this is a problem is that on a Windows keyboard the Alt key is right next to the spacebar (where the Command key is on a Mac keyboard). So if, like me, your keyboard shortcut muscle memory is to the key next to the spacebar then all your shortcuts get messed up on a Windows keyboard. Fortunately, there's a simple solution to this problem in the Keyboard tab of the Keyboard & Mouse Preference Pane. There if you click on the "Modifier Keys..." button you'll be taken to a dialog where you can easily remap the keys. So to make a Windows keyboard work like a Mac keyboard just change the option key to the command key and the command key to the option key as follows:

You'll also note that the Modifier Keys dialog lets you take care of another annoyance, the anachronistic Caps Lock key. Personally I find Caps Lock worse than useless as I sometimes inadvertently hit it. So you can turn it off altogether as I've done here, or you can set it to emulate one of the other keys (as Unix and Linux aficionados sometimes like to do).
So if you like to use a Windows keyboard with your Mac for whatever reason, these modifier keys settings will help keep you sane. Since my preferred keyboard is an old-school buckling-spring EnduraPro 104, these settings have been a great boon to me.











Reader Comments (Page 1 of 2)
9-13-2007 @ 3:15PM
Alan said...
Is it possible to have these settings automatically switch, depending on what keyboard is plugged in? At home, I prefer to use an external (Windows) keyboard, but on the road it's too much trouble to bring it along, so I use the built-in Macbook keyboard.
Reply
9-13-2007 @ 3:23PM
Dave Wood said...
I was just about to ask that same question. I use a Windows keyboard at home and at the office on my MacBookPro, but need to manually switch the keys when on the road or using the MacBookPro on my lap!
I'm sure it could be done with some apple script, but I haven't found it yet.
Reply
9-13-2007 @ 3:25PM
Jon said...
I have the exact problem as Alan. Please, someone point us in the right direction! It bugs me every time I have to switch between the work external USB kbd and the internal one to have to switch settings *again*.
Reply
9-13-2007 @ 3:26PM
Mat Lu said...
@1 & 2: I'll post on this very question tomorrow. Stay tuned!
Reply
9-13-2007 @ 3:37PM
adisor19 said...
The per keyboard settings are available in Leopard only ;)
Either insall a leaked build or wait till October :)
Adi
Reply
9-13-2007 @ 3:49PM
maxxel said...
while we're on the subject (keyboard),
how to change Command+` (backward Command+Tab) to Command+§ ?
i wish to change it because on US keyboard, tab and ` are one above another and on international one, they are far apart, because ` key is next to left shift.
Reply
9-13-2007 @ 3:55PM
Galley said...
I personally wouldn't go through all that hassle; I'd buy a $30 Apple keyboard. I guess if you were dual-booting it would be a different story.
Reply
9-13-2007 @ 3:57PM
maxxel said...
ad #6
using Ukelele to alter keyboard definition doesn't help.
Reply
9-13-2007 @ 4:23PM
G-WiZ said...
I do this all the time with my Microsoft Natural Elite keyboard at work. I bring in my MacBook Pro and have to adjust the settings EVERY time, then at the end of the day I switch back. I can at least use Quicksilver to bring up the keyboard pref panel quickly but there's no way to hotkey the keyswap using QS which you can do for network locations.
Reply
9-13-2007 @ 4:51PM
djdead said...
Try controllermate (http://www.orderedbytes.com/controllermate/). I use it to change the modifier keys on a logitech G15 while simultaneously leaving the modifier keys as they are for the macbook keyboard. =)
Reply
9-13-2007 @ 4:58PM
Steve said...
Does this button only appear when a non-mac keyboard is plugged in? On my Mac Pro (10.4.10) with a Mac keyboard & Mighty Mouse I do not have a "modifier keys" button at all.
Reply
9-13-2007 @ 5:09PM
Paul said...
Here is a somewhat lengthy way to automatically switch the keyboard. The method uses a program called MarcoPolo as well as applescripts...
Link: http://fall-line.com/2007/07/02/change-keyboard-modifier-keys-automatically-on-osx-with-applescript
Reply
9-13-2007 @ 6:23PM
Nevan said...
I use Doublecommand to do this. It's a little easier than the Keyboard pref pane, but still a pain to do every time.
http://doublecommand.sourceforge.net/
The developer promises:
"The highest priority now is having settings per keyboard, or at least only applying DoubleCommand to a single keyboard."
Reply
12-08-2007 @ 12:23PM
Jake said...
You don't have to set DoubleCommand every time if you use the 'system' preference inside of the DC control panel; of course I have the opposite problem than described above. I like to use the CTRL key as my Command key but for some reason when I set that up, I lose my ALT key altogether, and can no longer select my operating system upon startup with Boot Camp. Very annoying.
12-09-2007 @ 10:54PM
Nevan said...
@Jake: My problem is that I use a PC keyboard with a laptop, so I keep changing my settings. At home, I use the PC keyboard, but outside I use the laptop keyboard. Doublecommand has promised that they'll make it so that any keyboard is detected, but it hasn't happened yet.
BTW, I always use the 'user' setting, so I don't have to type in my password. What I've been looking for is a script I can run to automatically set Doublecommand to setting "80" (swapped alt and command) if it's set to '0' and vice versa.
9-13-2007 @ 7:32PM
David Fischer said...
Or use Microsoft's Keyboard drivers for MS USB or Wireless keyboards. It enables modifier key swapping without affecting a laptop's built in keyboard setup.
As for Apple keyboards...I'll buy one when they've got a curved or ergo keyboard.
Reply
9-13-2007 @ 9:51PM
Ron said...
I use the Microsoft Intellitype drivers (they work with any external keyboard), which allow you to specify key layouts for your external keyboard separately from the MacBook keyboard.
It also allows you to do some additional functionality which can't be done with the standard Apple preferences pane, such as assigning keys to change the volume, pause and start iTunes, etc.
Reply
9-14-2007 @ 11:22AM
Robert Brodrecht said...
@Paul
I recently grabbed that script and modified it. The problem I had with it was that the author changed all the modifier keys back to defaults. I personally am sick of the caps lock key. So, I disable it. When the script resets to default, it turns the caps lock key back on.
In addition to changing the delay to .1 to speed the script up, I replaced:
else
-- We're in PC keyboard mode. Swap back to the defaults
click button "Restore Defaults"
end if
with:
-- We're in PC keyboard mode. Swap back to the defaults
click pop up button 3
click menu item 3 of menu 1 of pop up button 3
delay 0.1
click pop up button 4
click menu item 4 of menu 1 of pop up button 4
delay 0.1
I run this script when I login. When I'm at work, I've already plugged in my eternal keyboad, mouse, and monitor. Nothing fancy, but it works.
The only bug I've found is that if you have been playing with the system prefs and don't have the "Keyboard & Mouse" tab open when you quit, the script errors out. For whatever reason, it doesn't swap to the correct tab before continuing, or AppleScript doesn't do the "tell" correctly. I'm not sure, since I don't know AppleScript well. So, make sure you click back to the correct tab before closing system prefs.
I also popped off my alt key and windows key and swapped them to make it a little more Mac-like.
Reply
10-08-2007 @ 10:39AM
ZuDfunck said...
I sure want to thank you for that
I bought a bluetooth Apple keyboard and I have been hitting that key constantly and this tip will save my sanity!
Thanx ZuD
Reply
10-08-2007 @ 6:40PM
John Carroll said...
THANK YOU VERY MUCH ~ i clicked the 'no action' and feel better already!
thanks alot!
JohnC :]
Reply