X11
鍵盤事件未到達 X 伺服器
我在沒有 GUI 的 Raspbian 10 (buster) 上。然後我安裝了 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
。有任何想法嗎?
我認為您的鍵盤可以工作,但 X 應用程序可能沒有焦點。試試這個。在 ~/.xinitrc 添加一行(如果文件不存在則創建文件)
xterm &
這告訴 startx 在啟動時執行該命令。嘗試在那裡輸入。如果它不起作用並且您有滑鼠,請點擊 xterm 視窗並再次鍵入。如果您沒有滑鼠,請嘗試使用 Alt-tab 並查看是否可以鍵入。