Keyboard sticks and repeats last input

I am having almost exactly the problem described in https://forum.manjaro.org/t/keyboard-becomes-unresponsive-and-repeats-last-input-infindefinitely-with-mute-and-volume-up/51894 though I am on KDE. (apologies for the lack of link, this is my first post and I don’t have link privileges apparently).

To summarise:

  • Sometimes the laptop keyboard becomes unresponsive
  • The touchpad remains responsive
  • If you connect a USB keyboard, it works
  • The laptop keyboard does not resume working until you restart.

The differences are:

  • I have observed this behavior only twice. The first time, the keyboard appeared to simply be unresponsive.
  • When it happened this morning, I was in command mode in Intellij (with Vim enabled) and Intellij was getting repeated x key presses (so, yes, it was deleting everything on its own)
  • I have not identified a particular key that triggers the behaviour.
  • KDE
  • Dvorak keyboard layout.

Other info:

  • KDE has my keyboard as “Generic | Generic 86-key PC”. I do have “repeat the key” selected for “when a key is held”, but I’m pretty sure the system is not interpreting the key as being held (switch from Intellij to Konsole didn’t result in repeated Xs)
  • Kernel is 5.15.21-1, no pending updates.

Some more info. I’m just digging around on the arch wiki to see if I suddenly understand what is happening.

$ setxkbmap -print -verbose 10
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc86
layout:     us,jp
variant:    dvorak,dvorak
options:    caps:escape_shifted_capslock
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us(dvorak)+jp(dvorak):2+inet(evdev)+capslock(escape_shifted_capslock)
geometry:   pc(pc86)
xkb_keymap {
        xkb_keycodes  { include "evdev+aliases(qwerty)" };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+us(dvorak)+jp(dvorak):2+inet(evdev)+capslock(escape_shifted_capslock)"      };
        xkb_geometry  { include "pc(pc86)"      };
};
$ cat /etc/X11/xorg.conf.d/00-keyboard.conf
# Read and parsed by systemd-localed. It's probably wise not to edit this file
# manually too freely.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us"
        Option "XkbVariant" "dvorak"
EndSection