UK Macintosh USB keyboard mapping incorrect after 14.04 update. How can I fix it?

After updating to 14.04, my keyboard layout isn't quite right. I'm using a wired usb macintosh keyboard with UK keys.

It used to be ok before the update, I even blogged about the need to select "English (UK, Macintosh)".

Now the problem seems to be that the §/± key is swapped with the `/~ (backtick/tilde). There may be others I haven't noticed yet. @, £ and $ all seem fine.

None of the UK presets work for me, any ideas of the cause/solution?


I'm running Lubuntu Desktop on top of Ubuntu Server 14.04 LTS on a virtual machine on a Macbook Air mid 2013 running VMware Fusion 7.1 on OS X Yosemite 10.10.1.

Assuming you're using Keyboard Layout Handler from the panel, first remove the gb(mac) keyboard layout from your list. And make sure you have apple_laptop set as the keyboard model.

Go to /usr/share/X11/xkb/symbols as root and edit the file gb using your favourite editor. Search for English (UK, Macintosh). You will now see 2 lines looking like this:-

key <TLDE> {      [         section,       plusminus ]    };
key <LSGT> {      [           grave,      asciitilde ]    };

Comment them out or delete them, and add a line looking like this:-

key <LSGT> {        [         section,       plusminus ]    };

Save the file. Now we need to get the xkb subsystem to recompile the definition. I did it by doing

rm /var/lib/xkb/*

without injury, but you may know a better way. Now go back to the panel Keyboard Layout Handler and re-add the gb(mac) keyboard layout. It works okay now!

You might want to change /usr/share/X11/xkb/symbols/macintosh_vndr/gb in the same way, just to be neat.