Switch ep. 2: the keyboard

Well, some bits of this are easy: here’s a MacOS X version of GVim and Vim, which works nicely, is easy to install, and is simply vim/gvim. Great stuff!

But some bits are harder. Remember I was complaining about that silly ± / § key in the top corner of UK/Irish MacBook Pro keyboards? Some investigation reveals that I’m far from alone in this:

‘it fucks up application switching’

‘I hate my MacBook Pro’

a forum post looking for help

another forum post

There are a number of apps that offer key remapping, but for no apparent reason they limit themselves to “popular” remappings only, such as swapping the Control and Caps-Lock keys etc. I presume this is because that was easy to code ;)

The one that does work fully is Ukelele. Watch out though — it comes with a raft of caveats. It’s buggy, at least dealing with my MBP keyboard under OSX 10.5.5; the “Copy Key” functionality doesn’t work, and you need to start using a key mapping file from the Ukelele package, not a system one or one you’ve downloaded, otherwise it’ll silently produce an output file that doesn’t recognise any keys at all. On top of this, each time you make changes, you need to log out and log back in again for them to try them out. (Small mercies: at least you don’t need to do a full reboot, I suppose.)

I’m not impressed by this whole keyboard issue. If you look at photos of the US MacBook Pro keyboard, it’s clear that it doesn’t have the stunted tetris-style Enter and Left-Shift keys that the UK/Irish one does. It also has the tilde key in the normal place, the top left, instead of some bizarre symbol that isn’t even used in this keyboard’s locale, and as Ash Searle noted, when you’re a developer, the # is a hell of a lot more useful than the £ symbol. They’ve basically screwed with a good US keyboard design to bodge in a few extra keys they needed to deal with the tricky European corner cases.

All that would be relatively minor, however, if I could remap the keys to suit my tastes — but it was pretty damn tricky to do that. Key remapping needs to be an easy feature!

I’m still working on the fixed key layout file, but I may post it here once it’s finished to save other Googlers the bother…

Update:: here’s the fixed key layout file:

Irish Fixed.keylayout

Save that to ~/Library/Keyboard Layouts/ , then open System Preferences -> International, select Input Menu, and choose Irish Fixed from the list, and ensure “Show input menu in the menu bar” is on. Close that window, then select “Irish Fixed” from the input menu left of the clock on the menu bar. Log out, and log back in again, and the keys should be sane…

(thanks to Sonic Julez for the MBP key image)

This entry was posted in Uncategorized and tagged , , , , , , . Bookmark the permalink. Both comments and trackbacks are currently closed.

10 Comments

  1. Posted September 28, 2008 at 12:28 | Permalink

    You can order MacBooks with a US keyboard even here in the UK if that’s what you’d prefer, though it’s a bit late now I guess. I find exactly the same kind of frustrations with my UK Logitech keyboard which matches the Windows keyboard layout. As best I can tell, UK keyboards are just messed up – maybe I’m just a foreigner though…

  2. Posted September 28, 2008 at 12:32 | Permalink

    My personal pet hate about the keyboard is the fact the @ sign and ” are swapped. That requires me to remap my brain when I go from editing code on the MacBook to my PC based Linux box. The £ and # is also unforgivable, and like you discovered, the US version is sane. You should have seen the looks my last Macbook got in the US earlier in the year.

    Anyway, I should get one of those portable usb keyboards. Some keys on this laptop don’t work 100% of the time and since it was an insurance replacement I haven’t bothered to ring Apple about fixing it. An external keyboard would be better anyway because of my big hands.

    PS. The “Notify me of followup…” checkbox is unchecked after previewing this comment, and the Technorati top 100 is a 403 right now!

  3. Lars Balker Rasmussen
    Posted September 28, 2008 at 13:20 | Permalink

    I’m Danish, and I’ve been using US keyboards for decades. I recently bought an iMac and discovered that they don’t even SELL US layouts in Europe. Bastards.

    So I bought (by proxy) a keyboard in the US.

    Does the MacBook keyboard have a FRU#? It was pretty trivial to get a new US keyboard for my ThinkPad.

  4. Posted September 28, 2008 at 20:31 | Permalink

    argh, that 403 is an NFS stale filehandle between the VM that runs the script and the web-serving VM!! stupid Linux NFS. thanks for reporting it.

    Donncha, do you fancy trying out the key layout I’ve made?

    Irish Fixed.keylayout

    Save that to ~/Library/Keyboard Layouts/ , then open System Preferences -> International, select Input Menu, and choose Irish Fixed from the list, and ensure “Show input menu in the menu bar” is on. Close that window, then select “Irish Fixed” from the input menu left of the clock on the menu bar. Log out, and log back in again, and the keys should be sane…

  5. Posted September 28, 2008 at 20:32 | Permalink

    @Lars: I was considering that as an option — buying a US keyboard and popping out the UK one to replace it. (btw the external kbd option suggested isn’t workable, as I’m using this as a genuine lap-top laptop.)

  6. Posted September 29, 2008 at 09:48 | Permalink

    Works a treat, thanks Justin! I’m more used to the tilde next to the Enter key but I’ll have a look through that file and rearrange that.

    Oh, stumbled :)

  7. Fart
    Posted September 29, 2008 at 13:07 | Permalink

    I don’t really get the problem with the tilde key not being at the top left, I kind of like it next to the ‘z’ key as it is far more easy to hit.. And I’ve assigned the quake-style Terminal access from Visor (http://www.blacktree.com/) to the (indeed) strange button left of the 1-key, which now provides me with instance terminal access.

  8. Posted September 29, 2008 at 14:42 | Permalink

    Excellent! I’ve put that into the main body of the post. thx Donncha!

  9. Posted September 30, 2008 at 16:15 | Permalink

    I ended up creating a (UK / British) PC keyboard layout in Ukelele which I’ve been quite happy with:

    British PC.keylayout

    As I’m still regularly hopping between PCs and Macs, it really helps. The only annoyance is that Opera doesn’t like the keyboard layout at all – it switches it from “British PC” back to the standard “British” layout that comes with OS X. Really weird… but I set things up so Ctrl+Space switches Input Source to get me back to the keyboard layout I can get on with things.

    Oh… Justin, feel free to copy that keyboard image over to your own site… I think I grabbed it off flickr in the first place anyway…

  10. Posted September 30, 2008 at 17:00 | Permalink

    Ash — thanks! Sorry, I was being lazy with that. ;)