Score:0

setxkbmap no longer works as expected

br flag

I'm on Ubuntu 20.04.3 LTS, gnome 3.36.8.

Part of my problem may be this: Keyboard Map is Changed Randomly (the dconf fix didn't work). Basically, when a new device is connected, the keyboard map seems to be reset, e.g. a USB webcam. The issue also occurs when a bluetooth device connects.

However, so far, I could fix this with setxkbmap, going back to my preferred layout (a custom layout). However, there are now situations where setxkbmap -layout gb works, but setxkbmap -layout custom does not. What happens is that when I run setxkbmap -layout custom, alphabetical keys no longer work. However, I can still cut and paste (e.g., setxkbmap -layout gb, which makes the input work again).

I do not think this is to do with my custom map per se, because I've used that map for a year now, without problems. What is possible that something in xkb changed.

The problem is fixed by logging out and in again.

I know this is really vague, but it's tricky to diagnose because it intermittent. Does anybody have any ideas how this can be fixed or how I can investigate?

Thanks!

Score:0
br flag

This answer is equally vague... but... Under Settings > Accessibility > Typing Assist, the sticky keys feature became enabled. Maybe I did this by accident, maybe it was during a system upgrade. Then it seems that somehow pressing ctrl would latch this. This may be a hw issue with my keyboard (bounce)? Or an issue with gnome, don't know. In any case, while it was clear that somehow the ctrl key was being locked, it was unclear to me where this came from.

Turning off stick keys fixed the problem.

You can check whether you have the same problem by installing xkbset and running

xkbset q

Look out for:

Accessibility Features (AccessX) = On
Sticky-Keys = On

You can disable these like so:

xkbset -st -twokey -accessx

This command will also release any latched keys. (On another example for using xkbset, see here: Disable Sticky Keys' "Locked After Being Successively Pressed Twice" Behavior)

However, while turning them off with xkbset, it doesn't seem to be (immediately?) reflected in the Settings GUI.

Another thing I tried was restarting gnome shell without logging out, e.g.

busctl --user call org.gnome.Shell /org/gnome/Shell org.gnome.Shell Eval s 'Meta.restart("Restarting…")' 

but this does not reset a 'stuck' key. (Unlike logging in/out, which does of course reset it.) Arguably, the above command should reset it, but it doesn't.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.