键盘事件未到达 X 服务器

键盘事件未到达 X 服务器

我使用的是 Raspbian 10(buster),没有 GUI。然后我安装了X服务器并做了一个startx,但是按键盘上的按键对屏幕没有任何影响,如图所示这个图片

当我插入键盘时,以下内容会写入/var/log/Xorg.0.log,这表明键盘实际上已被识别。

[  2121.984] (II) config/udev: Adding input device Logitech USB Keyboard System Control (/dev/input/event2)
[  2121.984] (**) Logitech USB Keyboard System Control: Applying InputClass "libinput keyboard catchall"
[  2121.984] (II) Using input driver 'libinput' for 'Logitech USB Keyboard System Control'
[  2121.986] (II) systemd-logind: got fd for /dev/input/event2 13:66 fd 26 paused 0
[  2121.986] (**) Logitech USB Keyboard System Control: always reports core events
[  2121.986] (**) Option "Device" "/dev/input/event2"
[  2121.986] (**) Option "_source" "server/udev"
[  2121.995] (II) event2  - Logitech USB Keyboard System Control: is tagged by udev as: Keyboard
[  2121.995] (II) event2  - Logitech USB Keyboard System Control: device is a keyboard
[  2121.995] (II) event2  - Logitech USB Keyboard System Control: device removed
[  2121.996] (**) Option "config_info" "udev:/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2:1.1/0003:046D:C31C.0008/input/input11/event2"
[  2121.996] (II) XINPUT: Adding extended input device "Logitech USB Keyboard System Control" (type: KEYBOARD, id 6)
[  2121.996] (**) Option "xkb_model" "logitech_base"
[  2121.996] (**) Option "xkb_layout" "us"
[  2121.996] (WW) Option "xkb_variant" requires a string value
[  2121.996] (**) Option "xkb_options" "terminate:ctrl_alt_bksp"
[  2122.003] (II) event2  - Logitech USB Keyboard System Control: is tagged by udev as: Keyboard
[  2122.003] (II) event2  - Logitech USB Keyboard System Control: device is a keyboard
[  2122.044] (II) config/udev: Adding input device Logitech USB Keyboard (/dev/input/event0)
[  2122.044] (**) Logitech USB Keyboard: Applying InputClass "libinput keyboard catchall"
[  2122.044] (II) Using input driver 'libinput' for 'Logitech USB Keyboard'
[  2122.046] (II) systemd-logind: got fd for /dev/input/event0 13:64 fd 30 paused 0
[  2122.046] (**) Logitech USB Keyboard: always reports core events
[  2122.046] (**) Option "Device" "/dev/input/event0"
[  2122.046] (**) Option "_source" "server/udev"
[  2122.053] (II) event0  - Logitech USB Keyboard: is tagged by udev as: Keyboard
[  2122.053] (II) event0  - Logitech USB Keyboard: device is a keyboard
[  2122.054] (II) event0  - Logitech USB Keyboard: device removed
[  2122.054] (**) Option "config_info" "udev:/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2:1.0/0003:046D:C31C.0007/input/input9/event0"
[  2122.054] (II) XINPUT: Adding extended input device "Logitech USB Keyboard" (type: KEYBOARD, id 7)
[  2122.054] (**) Option "xkb_model" "logitech_base"
[  2122.054] (**) Option "xkb_layout" "us"
[  2122.054] (WW) Option "xkb_variant" requires a string value
[  2122.054] (**) Option "xkb_options" "terminate:ctrl_alt_bksp"
[  2122.062] (II) event0  - Logitech USB Keyboard: is tagged by udev as: Keyboard
[  2122.062] (II) event0  - Logitech USB Keyboard: device is a keyboard
[  2122.065] (II) config/udev: Adding input device Logitech USB Keyboard Consumer Control (/dev/input/event1)
[  2122.065] (**) Logitech USB Keyboard Consumer Control: Applying InputClass "libinput keyboard catchall"
[  2122.065] (II) Using input driver 'libinput' for 'Logitech USB Keyboard Consumer Control'
[  2122.162] (II) systemd-logind: got fd for /dev/input/event1 13:65 fd 31 paused 0
[  2122.162] (**) Logitech USB Keyboard Consumer Control: always reports core events
[  2122.162] (**) Option "Device" "/dev/input/event1"
[  2122.162] (**) Option "_source" "server/udev"
[  2122.169] (II) event1  - Logitech USB Keyboard Consumer Control: is tagged by udev as: Keyboard
[  2122.169] (II) event1  - Logitech USB Keyboard Consumer Control: device is a keyboard
[  2122.169] (II) event1  - Logitech USB Keyboard Consumer Control: device removed
[  2122.170] (**) Option "config_info" "udev:/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2:1.1/0003:046D:C31C.0008/input/input10/event1"
[  2122.170] (II) XINPUT: Adding extended input device "Logitech USB Keyboard Consumer Control" (type: KEYBOARD, id 8)
[  2122.170] (**) Option "xkb_model" "logitech_base"
[  2122.170] (**) Option "xkb_layout" "us"
[  2122.170] (WW) Option "xkb_variant" requires a string value
[  2122.170] (**) Option "xkb_options" "terminate:ctrl_alt_bksp"
[  2122.177] (II) event1  - Logitech USB Keyboard Consumer Control: is tagged by udev as: Keyboard
[  2122.178] (II) event1  - Logitech USB Keyboard Consumer Control: device is a keyboard

我还怀疑键盘被识别了,因为当显示器休眠并且我按下 ESC 时,它被唤醒了。 Ctrl+Alt+ 也可以(我可以更改 tty)。

如果我这样做xinit,同样的事情也会发生。

我安装了以下相关软件包:

ii  x11-xserver-utils              7.7+8                               armhf        X server utilities
ii  xserver-common                 2:1.20.4-1+rpt1                     all          common files used by various X servers
ii  xserver-xorg                   1:7.7+19+b8                         armhf        X.Org X server
ii  xserver-xorg-core              2:1.20.4-1+rpt1                     armhf        Xorg X server - core server
ii  xserver-xorg-input-all         1:7.7+19+b8                         armhf        X.Org X server -- input driver metapackage
ii  xserver-xorg-input-libinput    0.28.2-2                            armhf        X.Org X server -- libinput input driver
ii  xserver-xorg-input-wacom       0.34.99.1-1+b6                      armhf        X.Org X server -- Wacom input driver
ii  xserver-xorg-legacy            2:1.20.4-1+rpt1                     armhf        setuid root Xorg server wrapper
ii  xserver-xorg-video-all         1:7.7+19+b8                         armhf        X.Org X server -- output driver metapackage
ii  xserver-xorg-video-amdgpu      18.1.99+git20190207-1               armhf        X.Org X server -- AMDGPU display driver
ii  xserver-xorg-video-ati         1:19.0.1-1                          armhf        X.Org X server -- AMD/ATI display driver wrapper
ii  xserver-xorg-video-fbdev       1:0.5.0-1+b2                        armhf        X.Org X server -- fbdev display driver
ii  xserver-xorg-video-nouveau     1:1.0.16-1                          armhf        X.Org X server -- Nouveau display driver
ii  xserver-xorg-video-radeon      1:19.0.1-1                          armhf        X.Org X server -- AMD/ATI Radeon display driver
ii  xserver-xorg-video-vesa        1:2.4.0-1+b1                        armhf        X.Org X server -- VESA display driver

正如我在 中看到的那样,事件实际上是生成的showkey

有任何想法吗?

答案1

我认为您的键盘可以工作,但 X 应用程序可能没有焦点。尝试这个。在 ~/.xinitrc 中添加一行(如果不存在则创建该文件)

xterm &

这告诉 startx 在启动时运行该命令。尝试在那里打字。如果它不起作用并且您有鼠标,请单击 xterm 窗口并再次键入。如果您没有鼠标,请尝试执行 Alt-tab 并查看是否可以输入。

相关内容