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?

  • adjust they keys with xmodmap ? – exussum May 30 '14 at 13:02

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.

| improve this answer | |
  • Thanks for the suggestion but it didn't work in my case :( – matt burns Jan 6 '15 at 17:17
  • Just done it again with 16.04. There's now a "macbook79" keyboard model which matches my MacBook Air and Apple Wireless Keyboard much beter than "apple_laptop". The same XKB files need editing in the same way as before - /usr/share/X11/xkb/symbols/gb and /usr/share/X11/xkb/symbols/macintosh_vndr/gb, but when you go into Keyboard Layout Handler and "Add" the "gb" layout, make sure you click on the ">" to the left of the Union Jack flag and explicitly select the "gb(mac)" layout. When you go back to the Keyboard Layout Handler screen you'll see "mac" in the "Variant" column. – kbro Nov 25 '16 at 9:41
  • Just did this exactly as instructed on Ubuntu 16.04. This was the only thing that solved my problem. Thank you! – Søren Mortensen Dec 27 '17 at 18:40

Try this:
Open Keyboard preferences. From the System menu, select Preferences, and then Keyboard from the submenu.
Select Layouts. In the resulting window, select the Layouts tab.
Click +Add. Select your preferred keyboard layout by country or by language.

Look at the virtual keyboard and see if it matches your keyboard's layout.
When you find the layout you need, click +Add.

In the Keyboard Preferences window click on Layout options. enter image description here Change your keyboard-switching hot key. In the Key(s) to change layout sub-menu select the what key combination would you like to use to quickly switch between layouts. enter image description here

Source: Wikihow

| improve this answer | |
  • 1
    Unfortunately, the current version of the Ubuntu keyboard menus look nothing like this. Anyway, your answer talks about just finding the correct layout. There is no layout that matches my keyboard, although it's close. I just need to swap § and `. – matt burns Jun 13 '14 at 10:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.