Keyboard switching have stopped working

I have two keyboard layouts enabled, and I have configured a hotkey for swapping between them. It used to work like a charm, until recently when my distribution switched me over to wayland. Now it works, kinda, sometimes.

Suddenly I realized it did not swap when I hit the shortcut, tried it again and the indication on screen said it had changed, but the keys did not produce the correct characters. I was a bit annoyed.

The next day it worked fine, and I switched back and forth. Then a few days later it failed again. :frowning:

Any suggestions for how to debug and solve this issue?

I wonder if it something someone else is experiencing, or if there are some well known actions to take under wayland that I’m missing?

hi, welcome.

it’s a good idea to go and verify that nothing has change, or even remake your shortcut definition at settings > input devices > keyboard > layouts

make sure they are still set up as you like.

did you have a modifier+letterkey type shortcut defined?

i just use Left Ctrl + Left Shift as it’s easy to mash.

Thanks for your reply!

Yes, I did check it had not suddenly gone missing, and even recreated it. I use C-M-k as it’s not used by anything else.

you mean ctrl+meta+k?

what happens if you go to settings > input devices > keyboard > advanced tab, under the heading Switching to another Layout

and just check Left Ctrl+Left Win from the list

You mean these settings?

keyswitching1

keyswitching2

What is that “Legacy Shortcuts” anyway?

Yeah, that was one I had not tested. Huh. It worked!

Now the question is why, and why the topmost one that would be most obvious one to try did not work??

one thing i notice is that on the configure page you have Current Window Only, and that’s probably giving issues… the default is All Windows

the legacy settings take you to the key bindings page where you can pick things like Left Ctrl+Left Win form a list.

I know it say Current Window. That has been how I want it to work, and it has worked fine. Like I wrote, when I tested the Legacy, I could suddenly change keymaps again. The question is why? Standard doesn’t work, but legacy does? It sure as hell would confuse newbies!

so if you:

  • set it to all windows

  • clear both options under legacy

  • reset the shortcut to meta+alt+k

does everything work, or no?

Huh. That is really weird. Yes, that does work.

But, then changing it back to my prefered setting of only the current window, it still works.

So, moving from X11 to Wayland you have to set it to All Windows before setting it to anything else? That is one of the most odd bugs I’ve seen.

the phenom is called emergent behavior, because in modern complex software it’s often impossible to traverse every possible path.

but often resorting to defaults and an known good path will set things right again.

just something to keep in the back of your head as our lives become more and more surrounded by untested software.

Thanks! That’s a debugging method I had not internalized.

Something seems to be a bit wonky still, as sometimes it swap keymaps when I haven’t pressen my hotkeys. I do have fat fingers, but still. Maybe my physical keyboard is acting up as well. Oh bother…