I currently have a UK keyboard, and I have configured Ubuntu 16.04 with both UK and Spanish layouts. I generally use the Spanish layout, because it is what I am used to.

Spanish layout: https://commons.wikimedia.org/wiki/File:KB_Spanish.svg

UK layout: https://commons.wikimedia.org/wiki/File:KB_United_Kingdom.svg

I have a problem though, with the key on the left of the letter Z: With the Spanish layout, I should get the symbol '<', but I get the symbol '\' instead, which is the one from the UK layout.

This is the only key I have a problem with, and it is very annoying. I have no idea where to start looking for an explanation, and it is very difficult to Google it.

  • 1
    As a debugging step, I would suggest trying a different physical keyboard. See if you get the same result and post your findings. – Jeff Sep 11 '18 at 12:28
  • 1
    Yes, I get the same result – markmb Sep 11 '18 at 12:51
  • 1
    I have a Windows VM inside my Ubuntu, in which I also configured both keyboard layouts. In the VM, that key works as expected. – markmb Sep 11 '18 at 14:23

I suspect that there is some Apple hardware involved. You can probably fix it by running this command:

gsettings set org.gnome.desktop.input-sources xkb-options "['apple:badmap']"

The "apple:badmap" XKB option switches the key to the left of Z and the key to the left of 1.

  • No, there is no Apple hardware involved. And the key to the left of '1' works as expected, no need to switch them. So, unfortunately, the command you provided doesn't change anything (tested it). – markmb Sep 12 '18 at 10:34

I still don't know why this happens, but I do have a workaround: swap the layouts.

I had as first layout the UK layout, and as second the Spanish layout. I swapped the order, and now it works fine.

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.