This appears to be a surprisingly complex problem, and worse, I'm not sure if it was a configuration change that I made or if it was an update to ubuntu that caused the problem. I'm running Ubuntu Studio 14.04, all the latest updates (Linux version 3.13.0-30-lowlatency (buildd@kissel)), on an Asus K55A. Here's what happened:

  • My keyboard lost some keys (due to extreme tropical humidity), namely the main "enter" key.
  • Using the numpad enter key ("KPEN") didn't work in vim (I don't know how vim intterpreted the keycode that it sent (which was 104), but it kept inserting an "M")
  • Thus, I dug into my xkb files and changed all KPEN mappings from KP_enter to Return
  • Simultaneously, I executed a bunch of backlogged updates that I hadn't done for the last month due to low bandwidth.
  • At some point after these two events, my KP Enter key started working in vim (presumably because of the changes I made), but I stopped being able to switch keyboard layouts.

Now, here's a more detailed description of the problem:

  • In my config, I have - and have had, since nothing has changed in my config - my default keyboard layout as EN_US and a secondary layout as LATAM (spanish). To switch between them, I use shift+caps lock. The xfce4-xkb-plugin worked as expected.
  • After this mysterious event, my config still looks identical, but pushing shift+caps lock does nothing but activate caps lock. Also, the xfce4-xkb-plugin doesn't show any other layout options, despite there being a second layout defined in my keyboard settings.

And here's what I've done for diagnostics:

  • Used a different keyboard. Fail: the problem persists (and didn't expect otherwise, since all symptoms point to a software problem)
  • Configured only latam layout in my keyboard settings (i.e., removed the us keyboard as an option). Fail: keyboard layout was still in english.
  • Switched to TTY1 using ctrl+alt+F1 and entered sudo loadkeys latam. Success: latam characters work.
  • Switched back to TTY7 (i.e., my desktop environment), fail: found keyboard was still in english.
  • In my desktop environment, I opened up xterm and did sudo loadkeys latam again. Fail: No errors, but didn't work either.
  • I then did sudo loadkeys --verbose latam > /tmp/latam.keys and sudo loadkeys --verbose us > /tmp/us.keys and ran a diff on the two files to verify that they were indeed different. The files were different (this makes sense, and suggests that loadkeys is doing its job correctly).
  • I then created a new account, test-me, and logged in to see if the problem was system wide. Fail: the problem is system-wide. There was no way to switch layouts.
  • Searched for xkb in processes list. Nothing showed up. Maybe that's normal, but I at least expected an xkb daemon to handle translations and stuff.
  • I ran setxkbmap -v 10 latam. Fail: I got the following output:

    setxkbmap -v 10 latam
    Setting verbose level to 10
    locale is C
    Warning! Multiple definitions of keyboard layout
       Using command line, ignoring X server
    Trying to load rules file ./rules/evdev...
    Trying to load rules file /usr/share/X11/xkb/rules/evdev...
    Applied rules from evdev:
    rules:      evdev
    model:      pc105
    layout:     latam
    Trying to build keymap using the following components:
    keycodes:   evdev+aliases(qwerty)
    types:      complete
    compat:     complete
    symbols:    pc+latam+inet(evdev)
    geometry:   pc(pc105)
    Error loading new keyboard description

Unfortunately, I don't know a whole lot about the key translation subsystem, so I'm a bit stuck now. What it looks like to me is that maybe for some reason the system is just discarding the whole user config and falling back on the system settings, but then I don't know why loadkeys wouldn't work in xterm.

Anyway, I'll leave it at that. I'll be happy to provide any new information. Thanks!


closed as off-topic by Braiam, vonbrand, jimmij, cuonglm, Archemar Nov 23 '15 at 7:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Braiam, vonbrand, jimmij, cuonglm, Archemar
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    It's not surprising that loadkeys didn't work in X, as it only changes the console keymap, not X keyboard layout. Try setxkbmap latam to see if X actually have the layout. There is no xkb daemon, xkb is part of X11. – Leiaz Nov 30 '14 at 10:37
  • Ok, cool. I didn't know about setxkbmap. I'm updating my question to add that output. – kael Nov 30 '14 at 14:35

Well, unfortunately, after a few days without luck, I decided to just reinstall the os. I installed, ran all the updates, changed KPEN to Return again, and ended up with a functioning keyboard. I have no idea what happened before, so unfortunately I can't provide any insights to anyone else trying to fix this.... Sorry!

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