Monday, April 27, 2009

Adding a # key to a British keyboard on a Mac

The British keyboard layout on the Mac was not designed for programmers. Real programmers need the # key and on US keyboards it's SHIFT-3. On the British keyboard layout SHIFT-3 is the £ (pound sign).

You can access # from 3 by typing ALT-3 (which some people call OPTION-3) but that just feels weird.

Happily, British Mac keyboards have a totally useless key just to the left of 1. You know the one, the one that has § and ± on it. I cannot recall ever having needed to type the section sign (I guess that's something lawyers want) or the plus/minus sign, so that key is up for grabs.

To remap it it's possible to use the program Ukelele to alter the keyboard layout so that the # sign is typed by that useless key.

Or if you are lazy you can just download my keyboard layout and install it in /Users/<you>/Library/Keyboard Layouts and then select it from the International menu on the Finder bar.

If the menu with the British flag on it is not available you can switch it on from the Input Menu section of the International pane in System Preferences. If the new keyboard layout (called British for Programmers) is not available in the drop-down menu, select it from the Input Menu section of the International pane and click the check box.

You will need to reboot your machine after copying the file into place.

1 comment:

Justin Mason said...

it's ridiculous, isn't it! this horribleness is one of the factors that drove me off the Mac. IMO, it's indicative of a lack of user testing in non-US locales....