Clobbering the Command Key

Posted by Brandon just about about 1 year ago

I’ve recently installed rdesktop via MacPorts to connect to Windows servers. It’s lightweight, fast, and I’m digging it. Definitely check out Matthias Miller’s guide here to get started.

Once you’ve done that, there is an additional step I’ve found useful. Whenever I use Command + Tab to switch windows, rdesktop sends the Windows key to the remote desktop which pops up the Start Menu. This becomes very annoying… The solution is to change the Command key to something else (I used Alt) with xmodmap.

First you’ll need to discover the keycode for your Command key using xev. From the X11 menu, start a terminal (it has to be an X11 terminal, the regular Terminal app won’t work for this). Run xev from the command line, press your Command key, and look for the keycode in the output. Mine turned out to be 63. I’m not sure how much this varies, but to eliminate any doubt, go ahead and run xev.

Finally, add a line to your .Xmodmap like so:

keycode 63 = Alt_L

This gets the job done for me. It fixes the Start Menu popping-up problem, plus it has the added benefit of saving my left thumb from having to bend uncomfortably over to the alt/option key when I’m accessing menus in Windows.