2

In short, I, in setting up my keyboard for multiple languages (I often have to type obscure characters for papers) I managed to accidentally rebind the "select next input" hotkey to Lshift+space instead of my intended alt+shift. Thinking nothing was amiss, I rebound the key immediately. However, since then when I have EITHER shift key held down I cannot get the space bar to produce any result whatsoever.

This only affects my user profile, and seems to apply across languages which tells me there must be a hotkey set somewhere to do "nothing". Yet resetting shortcuts under settings-devices-keyboard seems to have no effect. Also dpkg-reconfigure "dpkg-reconfigure keyboard-configuration" does not resolve the issue either.

I'd rather not have to restore a timeshift snapshot as I've done a lot to this machine in the past 24 hours and I'd rather not have to do it all again, especially if there's an easy fix.

  • Try using GNOME Tweaks to reset the combination, see this: https://askubuntu.com/questions/967364/ubuntu-17-10-and-later-cant-change-the-input-switching-shortcut-to-altshift – pomsky Oct 06 '18 at 10:41
  • Thanks, but no go. I did however find a solution related to a reddit thread, answer post coming. – Anathema M Oct 06 '18 at 10:50

1 Answers1

2

OKAY.

So after 4 hours of bashing my head against this wall I learned what the output of xmodmap means thanks to a helpful post buried deep in the depths of reddit.

If you, like me, accidentally overwrote one of the actual binds for your keyboard itself, it's a relatively easy fix.

For any other panicked user who has a random key not working, I highly suggest you do what I did:

Open a terminal,

Type "xmodmap -pke > ~/keymap.jackass" to output a full map of all keys and what they do to a vaguely readable text file. Open said file in gedit or your favourite text editor. Keep this keymap handy, you're going to need it.

Next, type xev -event keyboard to capture what happens when you're pushing the keys that aren't working (I did separate-together-separate to make it obvious what was different.) When nothing was visibly different in xev from pressing space or shift-space, I decided to stare blankly at the xmodmap for Keycode 65, which is the space bar. (Xev will tell you the keycode for each key you press. Handy.)

Now, when I looked my trusty keymap.jackass for keycode 65, I found a curious entry, it read "keycode 65 = space NoSymbol space NoSymbol NoSymbol NoSymbol NoSymbol NoSymbol space space thinspace nobreakspace" which may as well have been a foreign language to me. Fortunately there's resources to help you understand that the tabled entries here indicate what happens when modifier keys are pressed with the space bar. The first six entries are:

  1. Key [without modifier]

  2. Shift+Key

  3. Mode_switch+Key

  4. Mode_switch+Shift+Key

  5. ISO_Level3_Shift+Key (AltGr)

  6. ISO_Level3_Shift+Shift+Key (AltGr + shift).

So all I needed to do was get xmodmap to recognise that the second entry (shift+key) should not read NoSymbol but in fact read 'space'.

So, feeling like a hero for solving what would probably take any long term linux user five seconds, I changed my keymap.jackass entry for keycode 5 to read:

"keycode 65 = space space space NoSymbol NoSymbol NoSymbol NoSymbol NoSymbol space space thinspace nobreakspace"

Why did I do it there first? basic logic, with that long of a string I didn't want to miss an entry, so then I copied that line, and entered into my trusty terminal

'xmodmap -e "keycode 65 = space space space NoSymbol NoSymbol NoSymbol NoSymbol NoSymbol space space thinspace nobreakspace"'

Voila.

Working shift+space.

Don't be like me kids, learn what basic functions of xmodmap are early!

(Edit)Addendum: after reboot my xmodmap setting did not remain. A quick toss of the xmodmap -e command with the corrections into /home//.xinitrc resolved this on reboot. It's still probably not the best workaround but hey, there you have it.