Keyboard and mouse only working as root in Xorg?!

Sat, Oct 3, 2020 2-minute read

Ran into an issue which seems fairly common, but my particular steps to diagnose and “solve” the problem were not easy to figure out. After updating an old gentoo box that hadn’t been thoroughly updated in years, I ran into a problem where my keyboard and mouse were only accessible as root once I was in X. I could use the keyboard as myself in the console but as soon as I ran startx, it become unresponsive. I sshed into the box and did this to confirm that typing was being detected:

1
cat /dev/input/event13 
(substitute the device input event node for your keyboard above)

I tried to reload udev rules in case they had not run:

1
udevadm control -R
but the above command yielded this error: “no such file or directory” Checking for the presence of /run/udev/control I realized the file indeed did not exist. In my case I am still using udev rather than eudev, so running:
1
/lib/systemd/systemd-udevd&
got udev running and the control file created.

Then I decided to check how the event device nodes were being tagged:

1
udevadm info /dev/input/event13

This revealed that none of the attributes of the input device were being detected. At this point either disconnecting and reconnecting the keyboard or running the commands below made the keyboard accessible in xorg:

1
udevadm trigger --sysname=class/input/event13

If you are tailing ~/.local/share/xorg/Xorg.0.log at the same time that the preceding command was run, you should see something like:

config/udev: Adding input device SEJIN AlphaGrip AG5 USB Keyboard'
and you should see appropriate tagging by udev:
event13 'SEJIN AlphaGrip AG5 USB Keyboard: is tagged by udev as: Mouse'
event13 'SEJIN AlphaGrip AG5 USB Keyboard: is tagged by udev as: Keyboard'
event13 'SEJIN AlphaGrip AG5 USB Keyboard: device is a keyboard'

I am still missing some configuration step so that all this happens on boot automatically. If anyone has any ideas, please let me know.