TTY可用USB键盘但进图形界面不能用的临时解决

硬件: 笔记本,蓝天模具,i9-9900T + 1060

系统与图形: archlinux + gnome.wayland

系统有近半年没用,前天更新完后,USB键盘用不了,不过自带的PS/2键盘是能用的,重装系统后问题依旧

gnome-shell说它找不到

journalctl -b | grep 'Could not open device'

8月 15 05:31:28 EGLaptop gnome-shell[712]: Could not open device /dev/input/event9: GDBus.Error:System.Error.ENODEV: No such device
8月 15 05:31:28 EGLaptop gnome-shell[712]: Could not open device /dev/input/event10: GDBus.Error:System.Error.ENODEV: No such device
8月 15 05:31:28 EGLaptop gnome-shell[712]: Could not open device /dev/input/event11: GDBus.Error:System.Error.ENODEV: No such device
8月 15 05:31:45 EGLaptop gnome-shell[2632]: Could not open device /dev/input/event9: GDBus.Error:System.Error.ENODEV: No such device
8月 15 05:31:45 EGLaptop gnome-shell[2632]: Could not open device /dev/input/event10: GDBus.Error:System.Error.ENODEV: No such device
8月 15 05:31:45 EGLaptop gnome-shell[2632]: Could not open device /dev/input/event11: GDBus.Error:System.Error.ENODEV: No such device
8月 15 05:35:10 EGLaptop gnome-shell[2632]: Could not open device /dev/input/event11: GDBus.Error:System.Error.ENODEV: No such device
8月 15 05:35:10 EGLaptop gnome-shell[2632]: Could not open device /dev/input/event10: GDBus.Error:System.Error.ENODEV: No such device
8月 15 05:35:10 EGLaptop gnome-shell[2632]: Could not open device /dev/input/event9: GDBus.Error:System.Error.ENODEV: No such device
8月 15 05:37:39 EGLaptop gnome-shell[2632]: Could not open device /dev/input/event10: GDBus.Error:System.Error.ENODEV: No such device
8月 15 05:37:39 EGLaptop gnome-shell[2632]: Could not open device /dev/input/event9: GDBus.Error:System.Error.ENODEV: No such device
8月 15 05:37:39 EGLaptop gnome-shell[2632]: Could not open device /dev/input/event11: GDBus.Error:System.Error.ENODEV: No such device
8月 15 05:41:38 EGLaptop gnome-shell[2632]: Could not open device /dev/input/event10: GDBus.Error:System.Error.ENODEV: No such device
8月 15 05:41:38 EGLaptop gnome-shell[2632]: Could not open device /dev/input/event9: GDBus.Error:System.Error.ENODEV: No such device
8月 15 05:41:38 EGLaptop gnome-shell[2632]: Could not open device /dev/input/event11: GDBus.Error:System.Error.ENODEV: No such device

其实是有的

sudo evtest

/dev/input/event10: GouDan Tech. SK108 Consumer Control
/dev/input/event11: GouDan Tech. SK108
/dev/input/event9: GouDan Tech. SK108 Mouse

用fuser看了下,没有添加

sudo fuser -v /dev/input/event*

/dev/input/event11: root 603 F.... systemd-logind(只有这行)

/dev/input/event4: root 1 F.... systemd (笔记本的PS/2键盘)
root 603 F.... systemd-logind
erickg 24166 F.... gnome-shell

尝试过添加ACL规则,也没用,那就不是规则的问题。重新插拔gnome-shell还是不认

Aug 15 04:25:13 systemd-logind: Watching system buttons on /dev/input/event11 (GouDan Tech. SK108)
Aug 15 04:25:13 gnome-shell: Could not open device /dev/input/event11: GDBus.Error:System.Error.ENODE

也尝试过降级到半年前的gnome和systemd,结果不认,不知道哪里出问题。

临时解决方式: 使用keyd拿这个键盘外设

先安装lsusb,用来看键盘外设

sudo pacman -S usbutils

~/ >> lsusb
printout:
Bus 001 Device 009: ID 31d6:002a GouDan Tech. SK108 (the keyboard you need to add)

然后安装evtest来看USB键盘

sudo pacman -S evtest

我这边是3个,对着刚才lsusb出的设备名来,比如说你event10,那就在evtest出来的提示那里输入10然后回车,然后就按按键看看是否响应就行了

~/ >> sudo evtest
/dev/input/event10: GouDan Tech. SK108 Consumer Control (快捷键)
/dev/input/event11: GouDan Tech. SK108 (主键盘)
/dev/input/event9: GouDan Tech. SK108 Mouse (我也不知道什么时候多了个鼠标)

安装keyd

sudo pacman -S keyd

然后用keyd monitor找刚才记录下来的设备号,它除了设备的vendor和product,额外添加了哈希值用来辨别同一个外设的不同特征

sudo keyd monitor

device added: xxxx:xxxx:c911497d GouDan Tech. SK108 (/dev/input/event11) >> (按键)
device added: xxxx:xxxx:21146082 GouDan Tech. SK108 Consumer Control (/dev/input/event10) >> (快捷键)
device added: xxxx:xxxx:6670e8fa GouDan Tech. SK108 Mouse (/dev/input/event9)

在/etc/keyd/目录下创建default.conf,我这里用的gnome-text-editor

sudo gnome-text-editor /etc/keyd/default.conf

配置文件格式大概是这样

[ids]
xxxx:xxxx:c911497d
xxxx:xxxx:21146082

[main]

保存后关闭文件就有了,然后通过systemctl来启用keyd

sudo systemctl enable --now keyd

后续如果需要修改default.conf,修改好后执行reload即可

sudo keyd reload

截图 2026-08-15 16-45-40

截图 2026-08-15 16-43-16

看着像是GNOME的bug啊。

没重装前回滚内核和gnome后也读不到了,很怪。不过我重装也是保留/home来重装,也可能是~./里面有脏东西。但是没功夫折腾了,现在就这样用着了,功能键和主体都能用。

装个KDE Plasma,进去看看,如果没问题的话,就是GNOME的问题