我正在运行 Archlinux,但有一个奇怪的问题,由于某种原因,我的“Microsoft 有线键盘 600”被选为操纵杆和键盘。
Note: Output trimmed
─$ xinput list
Virtual core pointer id=2[master pointer (3)]
↳ Microsoft Wired Keyboard 600 id=9[slave pointer (2)]
Virtual core keyboard id=3[master keyboard (2)]
↳ Microsoft Wired Keyboard 600 id=8[slave keyboard (3)]
问题是我有一个 Xbox360 控制器,我用它来玩游戏,而另一个“操纵杆”把事情搞砸了。
我有一个解决方法,但它是手动的,而且我使用它很烦人。
sudo chmod 0000 /dev/input/event1 /dev/input/js0
sudo setfacl -b /dev/input/event1 /dev/input/js0
现在我知道我可以设置 udev 规则来在插入和拔出等时对设备执行操作...并且我尝试让它工作,但我只是不知所措。
我希望这个键盘的操纵杆部分甚至不会出现,/dev/input
但键盘仍然可以工作。
以下是udevadm
该键盘的一些输出,如果有人可以帮助我,我将非常感激。
实际键盘
─$ udevadm info --query=all --name=/dev/input/event0 1 ↵
P: /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1:1.0/0003:045E:0750.0007/input/input23/event0
N: input/event0
S: input/by-id/usb-Microsoft_Wired_Keyboard_600-event-kbd
S: input/by-path/pci-0000:00:1a.0-usb-0:1:1.0-event-kbd
E: DEVLINKS=/dev/input/by-path/pci-0000:00:1a.0-usb-0:1:1.0-event-kbd /dev/input/by-id/usb-Microsoft_Wired_Keyboard_600-event-kbd
E: DEVNAME=/dev/input/event0
E: DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1:1.0/0003:045E:0750.0007/input/input23/event0
E: ID_BUS=usb
E: ID_INPUT=1
E: ID_INPUT_KEY=1
E: ID_INPUT_KEYBOARD=1
E: ID_MODEL=Wired_Keyboard_600
E: ID_MODEL_ENC=Wired\x20Keyboard\x20600
E: ID_MODEL_ID=0750
E: ID_PATH=pci-0000:00:1a.0-usb-0:1:1.0
E: ID_PATH_TAG=pci-0000_00_1a_0-usb-0_1_1_0
E: ID_REVISION=0110
E: ID_SERIAL=Microsoft_Wired_Keyboard_600
E: ID_TYPE=hid
E: ID_USB_DRIVER=usbhid
E: ID_USB_INTERFACES=:030101:030000:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=Microsoft
E: ID_VENDOR_ENC=Microsoft
E: ID_VENDOR_ID=045e
E: LIBINPUT_DEVICE_GROUP=3/45e/750/111:usb-0000:00:1a.0-1
E: MAJOR=13
E: MINOR=64
E: SUBSYSTEM=input
E: USEC_INITIALIZED=4429367119
有趣的幽灵操纵杆
─$ udevadm info --query=all --name=/dev/input/event1
P: /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1:1.1/0003:045E:0750.0008/input/input24/event1
N: input/event1
S: input/by-id/usb-Microsoft_Wired_Keyboard_600-if01-event-joystick
S: input/by-path/pci-0000:00:1a.0-usb-0:1:1.1-event-joystick
E: DEVLINKS=/dev/input/by-id/usb-Microsoft_Wired_Keyboard_600-if01-event-joystick /dev/input/by-path/pci-0000:00:1a.0-usb-0:1:1.1-event-joystick
E: DEVNAME=/dev/input/event1
E: DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1:1.1/0003:045E:0750.0008/input/input24/event1
E: ID_BUS=usb
E: ID_FOR_SEAT=input-pci-0000_00_1a_0-usb-0_1_1_1
E: ID_INPUT=1
E: ID_INPUT_JOYSTICK=1
E: ID_INPUT_KEY=1
E: ID_INPUT_KEYBOARD=1
E: ID_MODEL=Wired_Keyboard_600
E: ID_MODEL_ENC=Wired\x20Keyboard\x20600
E: ID_MODEL_ID=0750
E: ID_PATH=pci-0000:00:1a.0-usb-0:1:1.1
E: ID_PATH_TAG=pci-0000_00_1a_0-usb-0_1_1_1
E: ID_REVISION=0110
E: ID_SERIAL=Microsoft_Wired_Keyboard_600
E: ID_TYPE=hid
E: ID_USB_DRIVER=usbhid
E: ID_USB_INTERFACES=:030101:030000:
E: ID_USB_INTERFACE_NUM=01
E: ID_VENDOR=Microsoft
E: ID_VENDOR_ENC=Microsoft
E: ID_VENDOR_ID=045e
E: LIBINPUT_DEVICE_GROUP=3/45e/750/111:usb-0000:00:1a.0-1
E: MAJOR=13
E: MINOR=65
E: SUBSYSTEM=input
E: TAGS=:seat:uaccess:
E: USEC_INITIALIZED=4429367514