Keymapping on the Mac.
February 13, 2005 5:24 AM   Subscribe

I've recently made the switch to Mac, and would like to do web development on the platform too (PHP webdev stuff). With PHP, I need frequent access to the backslash key, which on my Swiss-German layout is mapped to alt-shift-7 by default. This will Not Do.

Does anybody know of a (preferably free) program that allows me to re-map any key to another key? All the keyboard remapping tools I've tried just offer to map the modifier keys to a different modifier keys, akin to swapping keys, not remapping
posted by slater to Computers & Internet (10 answers total)
I don't think there's software that will directly do it (although Quickkeys ought to). But I found this document about how XML is used to define the keyboard, and therefore, should be mappable
posted by filmgeek at 5:45 AM on February 13, 2005

A search for "remap keys" at MacUpdate yielded:

Note that I haven't used either. Another possibility would be TypeIt4Me (which is a handy app anyhow)--this is really a keystroke expander, but would serve in your case, only a little more awkwardly than a key remapper.
posted by adamrice at 6:58 AM on February 13, 2005

I know two ways of doing this:

I had to do something like this once when a key stopped working -- I mapped it to the (useless to me) "little enter" key on the right bottom of the keyboard. I did it using OS9 and Resedit, saving the keyboard resource file as "US 2" and put it in the right place so that it shows up with the flags on the menubar. It was a pain but I did it. This way assumes you have OS9 and resedit and know what you're doing, but it has the advantage of being able to turn it on and off. More or less you are making a new international keymap.

I have since also switched the F9 expose key with that same little Enter key (on a different computer.) This time I did it by changing some .plist file in a text editor. Here's the notes I found:

"As root, edit /System/Library/Extensions/AppleADBKeyboard.kext/Contents/Info.plist. Find the key ADBVirtualKeys - its value is the array of keycodes returned by each key on the keyboard. Find the value 0x34 (the keycode for Enter), and replace it with 0x65 (the keycode for F9). Run 'touch /System/Library/Extensions' (not sure what this accomplishes, but it was in the original hint and should be harmless) and reboot. From now on the Enter key will act as another F9."

Be careful with this-- you might screw something up and I take no responsibility. You'll have to find the keycodes for the two keys you want to swap. I am pretty sure you can get them from Resedit or another OSX-friendly keymap program.
posted by neustile at 7:45 AM on February 13, 2005

To back up adamrice, DoubleCommand and uControl are the two biggies in this arena; not having used either myself I know they're constantly mentioned by the hardcore Mac community at SomethingAwful (shush, you!) and that they're supposed to be quality.
posted by cyrusdogstar at 7:57 AM on February 13, 2005

I think both may only remap non standard keys:

From their site:
"Can uControl remap any keys on my keyboard?

The question that one might want to ask is "should uControl remap any keys?" I think the answer is no. Mac OS X has a very good keyboard layout system that uses XML files to describe what key should produce what character and under what circumstances (read about it here). That is more than sufficient for many key remapping need"
posted by filmgeek at 9:26 AM on February 13, 2005

I would go with Quickeys or iKey, both which are macro editors. I prefer iKey myself and it is $30 compared to Quickeys' $99. In fact, I think that once you get used to doing macros, you'll put either one of these programs to good use with your web dev work. I use it, for example, to apply common HTML tags in any program and to clean up text by removing line breaks, double spaces, and other things. It got to where I was so used to them, I had to install Quickeys on my Windows PC at work so I wouldn't be so frustrated.
posted by Mo Nickels at 9:34 AM on February 13, 2005

Though not quite the answer to the question that you ask, completeness would suggest that I remind you that changing from a Swiss-German keyboard layout to a US layout (System Preferences -> International) would put the backslash as the unshifted key above Return, whatever is printed on the keys themselves.

It would of course change everything else too, so if you do your web development in English this may be all you need, otherwise it will probably cause more problems than it solves.
posted by Quinbus Flestrin at 9:58 AM on February 13, 2005

I've tried both DoubleCommand and uControl, and i just can't get 'em to work how I'd like. Macros seem like the backwards way of doing it. All I want is for apple-> to put in a backslash.

Switching to another keyboard layout is a no-no too, as I really do need äöü & àéè etc.

There MUST be such a program out there. Thanks for all the answers tho :)
posted by slater at 10:33 AM on February 13, 2005

I used to use ResEdit for this. OS X supports old Mac keyboard layout files if you convert them to a flat .rsrc file, so I've not needed to recreate my old ones.

But, I've seen a few editors for OS X. A google search brings up Ukelele, a Unicode keyboard layout editor.
posted by D.C. at 12:01 PM on February 13, 2005

After following D.C.'s link and doing some more googling, I came across Keyboard Maestro, which did the trick.

Thanx all!
posted by slater at 12:15 AM on February 14, 2005

« Older Improve My Japanese   |   Tax Refund? Newer »
This thread is closed to new comments.