大约一周前,鼠标上的滚轮停止工作了(不只是一只,是所有鼠标)。以下是我尝试调查和修复该问题的方法,但到目前为止都无济于事:
- 确认问题仍然存在于三款鼠标上。一款是 Corsair,两款是 Logitech
- 确认三款鼠标在其他操作系统上均可正常工作
- 在同一台机器上启动 Windows 并确认滚动功能正常,因此这不是硬件问题
xinput
显示鼠标,包括滚轮,按钮图为1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
xev
不显示滚轮移动时的任何事件。但是,鼠标中键单击可以正常工作。- 重新启动窗口管理器没有效果
- 切换到其他窗口管理器没有效果
- 重新启动 X 没有效果
- 重启无效
- 我有三个 USB 端口,更换任何一个都没有效果。尝试换用其他鼠标,问题依旧。尝试换用第三个鼠标,问题依旧。
- 更新所有软件并升级内核
- 在 Reddit、Super User、Quora 等网站上搜索答案,但所有解决方案都已被上述方法排除
- 在 Reddit r/linuxmint 上问了一个问题,但他们没有帮助
以下是我正在使用的一些信息:
- 操作系统:Linux Mint 18.1
- 内核:x86-64 Linux 4.10.0-14-generic
- WM:i3,也尝试了 awesome 和 cinnamon
我看到的最大问题是 xev 没有显示事件,而且这个问题在不同的鼠标上都是一样的。同样,这个问题是在一周前才出现的,而之前大约一年来它一直运行良好。我想不出在过去几天里有什么变化可能导致了这个问题,我越来越沮丧。
关于原因、解决方法以及下一步要调查什么,您有什么想法吗?
更新:根据评论,以下是输出xinput list-props
:
Device 'ckb1: Corsair Gaming Sabre PRO RGB Mouse':
Device Enabled (152): 1
Coordinate Transformation Matrix (154): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (276): 0
Device Accel Constant Deceleration (277): 1.000000
Device Accel Adaptive Deceleration (278): 1.000000
Device Accel Velocity Scaling (279): 10.000000
Device Product ID (269): 6940, 6959
Device Node (270): "/dev/input/event8"
Evdev Axis Inversion (280): 0, 0
Evdev Axes Swap (282): 0
Axis Labels (283): "Rel X" (162), "Rel Y" (163), "Rel Z" (581), "Rel Rotary X" (582), "Rel Rotary Y" (583), "Rel Rotary Z" (584), "Rel Horiz Wheel" (489), "Rel Dial" (585), "Rel Vert Wheel" (275), "Rel Misc" (586), "None" (0), "None" (0), "None" (0), "None" (0), "None" (0)
Button Labels (284): "Button Left" (155), "Button Middle" (156), "Button Right" (157), "Button Wheel Up" (158), "Button Wheel Down" (159), "Button Horiz Wheel Left" (160), "Button Horiz Wheel Right" (161), "Button Side" (273), "Button Extra" (274), "Button Forward" (298), "Button Back" (299), "Button Task" (300), "Button 8" (579), "Button 9" (580), "Button Unknown" (272), "Button Unknown" (272), "Button Unknown" (272), "Button Unknown" (272), "Button Unknown" (272), "Button Unknown" (272), "Button Unknown" (272), "Button Unknown" (272), "Button Unknown" (272), "Button Unknown" (272)
Evdev Scrolling Distance (285): -77, -77, 1
Evdev Middle Button Emulation (286): 0
Evdev Middle Button Timeout (287): 50
Evdev Third Button Emulation (288): 0
Evdev Third Button Emulation Timeout (289): 1000
Evdev Third Button Emulation Button (290): 3
Evdev Third Button Emulation Threshold (291): 20
Evdev Wheel Emulation (292): 0
Evdev Wheel Emulation Axes (293): 0, 0, 4, 5
Evdev Wheel Emulation Inertia (294): 10
Evdev Wheel Emulation Timeout (295): 200
Evdev Wheel Emulation Button (296): 4
Evdev Drag Lock Buttons (297): 0
evtest
当我上下滚动滚轮时的输出:
Event: time 1491756163.211018, type 2 (EV_REL), code 8 (REL_WHEEL), value -1
Event: time 1491756163.211018, -------------- SYN_REPORT ------------
Event: time 1491756163.459021, type 2 (EV_REL), code 8 (REL_WHEEL), value -1
Event: time 1491756163.459021, -------------- SYN_REPORT ------------
Event: time 1491756163.684019, type 2 (EV_REL), code 8 (REL_WHEEL), value -1
Event: time 1491756163.684019, -------------- SYN_REPORT ------------
Event: time 1491756164.165007, type 2 (EV_REL), code 8 (REL_WHEEL), value -1
Event: time 1491756164.165007, -------------- SYN_REPORT ------------
Event: time 1491756164.582066, type 2 (EV_REL), code 8 (REL_WHEEL), value 1
Event: time 1491756164.582066, -------------- SYN_REPORT ------------
Event: time 1491756164.712050, type 2 (EV_REL), code 8 (REL_WHEEL), value 1
Event: time 1491756164.712050, -------------- SYN_REPORT ------------
Event: time 1491756164.872037, type 2 (EV_REL), code 8 (REL_WHEEL), value 1
Event: time 1491756164.872037, -------------- SYN_REPORT ------------
Event: time 1491756165.095999, type 2 (EV_REL), code 8 (REL_WHEEL), value 1
Event: time 1491756165.095999, -------------- SYN_REPORT ------------
Event: time 1491756166.027074, type 2 (EV_REL), code 8 (REL_WHEEL), value -1
Event: time 1491756166.027074, -------------- SYN_REPORT ------------
Event: time 1491756166.419054, type 2 (EV_REL), code 8 (REL_WHEEL), value -1
Event: time 1491756166.419054, -------------- SYN_REPORT ------------
更新 2:/var/log/Xorg.0.log 的相关部分。需要说明的是,这里使用的鼠标是 Corsair,但我在使用 Logitech 和 Microsoft 鼠标时也遇到过同样的问题。
(II) config/udev: Adding input device ckb1: Corsair Gaming Sabre PRO RGB Mouse (/dev/input/event6)
(**) ckb1: Corsair Gaming Sabre PRO RGB Mouse: Applying InputClass "evdev keyboard catchall"
(II) Using input driver 'evdev' for 'ckb1: Corsair Gaming Sabre PRO RGB Mouse'
(**) ckb1: Corsair Gaming Sabre PRO RGB Mouse: always reports core events
(**) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Device: "/dev/input/event6"
(--) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Vendor 0x1b1c Product 0x1b2f
(--) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Found 20 mouse buttons
(--) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Found keys
(II) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Forcing relative x/y axes to exist.
(II) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Configuring as mouse
(II) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Configuring as keyboard
(**) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: YAxisMapping: buttons 4 and 5
(**) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
(**) Option "config_info" "udev:/sys/devices/virtual/input/input15/event6"
(II) XINPUT: Adding extended input device "ckb1: Corsair Gaming Sabre PRO RGB Mouse" (type: KEYBOARD, id 14)
(**) Option "xkb_rules" "evdev"
(**) Option "xkb_model" "pc105"
(**) Option "xkb_layout" "us"
(II) config/udev: Adding input device ckb1: Corsair Gaming Sabre PRO RGB Mouse (/dev/input/event8)
(**) ckb1: Corsair Gaming Sabre PRO RGB Mouse: Applying InputClass "evdev pointer catchall"
(**) ckb1: Corsair Gaming Sabre PRO RGB Mouse: Applying InputClass "evdev keyboard catchall"
(**) ckb1: Corsair Gaming Sabre PRO RGB Mouse: Applying InputClass "Natural Scrolling"
(II) Using input driver 'evdev' for 'ckb1: Corsair Gaming Sabre PRO RGB Mouse'
(**) ckb1: Corsair Gaming Sabre PRO RGB Mouse: always reports core events
(**) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Device: "/dev/input/event8"
(--) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Vendor 0x1b1c Product 0x1b2f
(--) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Found 20 mouse buttons
(--) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Found scroll wheel(s)
(--) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Found relative axes
(--) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Found x and y relative axes
(--) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Found keys
(II) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Configuring as mouse
(II) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Configuring as keyboard
(II) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: Adding scrollwheel support
(**) Option "VertScrollDelta" "-77"
(**) Option "HorizScrollDelta" "-77"
(**) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: YAxisMapping: buttons 4 and 5
(**) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
(**) Option "config_info" "udev:/sys/devices/virtual/input/input16/event8"
(II) XINPUT: Adding extended input device "ckb1: Corsair Gaming Sabre PRO RGB Mouse" (type: KEYBOARD, id 15)
(**) Option "xkb_rules" "evdev"
(**) Option "xkb_model" "pc105"
(**) Option "xkb_layout" "us"
(EE) BUG: triggered 'if (axnum >= dev->valuator->numAxes)'
(EE) BUG: ../../Xi/exevents.c:2103 in InitValuatorAxisStruct()
(EE)
(EE) Backtrace:
(EE) 0: /usr/lib/xorg/Xorg (xorg_backtrace+0x4e) [0x560d79deaade]
(EE) 1: /usr/lib/xorg/Xorg (InitValuatorAxisStruct+0x67) [0x560d79d7b677]
(EE) 2: /usr/lib/xorg/modules/input/evdev_drv.so (0x7f48d221e000+0x4b15) [0x7f48d2222b15]
(EE) 3: /usr/lib/xorg/modules/input/evdev_drv.so (0x7f48d221e000+0x58de) [0x7f48d22238de]
(EE) 4: /usr/lib/xorg/modules/input/evdev_drv.so (0x7f48d221e000+0x6d23) [0x7f48d2224d23]
(EE) 5: /usr/lib/xorg/Xorg (ActivateDevice+0x4a) [0x560d79c80c4a]
(EE) 6: /usr/lib/xorg/Xorg (0x560d79c38000+0xa2b19) [0x560d79cdab19]
(EE) 7: /usr/lib/xorg/Xorg (0x560d79c38000+0xb4f0b) [0x560d79cecf0b]
(EE) 8: /usr/lib/xorg/Xorg (0x560d79c38000+0xb54f3) [0x560d79ced4f3]
(EE) 9: /usr/lib/xorg/Xorg (config_init+0x9) [0x560d79cebea9]
(EE) 10: /usr/lib/xorg/Xorg (InitInput+0xbb) [0x560d79ccefdb]
(EE) 11: /usr/lib/xorg/Xorg (0x560d79c38000+0x57d91) [0x560d79c8fd91]
(EE) 12: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0xf0) [0x7f48d8c8d830]
(EE) 13: /usr/lib/xorg/Xorg (_start+0x29) [0x560d79c7a049]
(EE)
(II) evdev: ckb1: Corsair Gaming Sabre PRO RGB Mouse: initialized for relative axes.
(**) ckb1: Corsair Gaming Sabre PRO RGB Mouse: (accel) keeping acceleration scheme 1
(**) ckb1: Corsair Gaming Sabre PRO RGB Mouse: (accel) acceleration profile 0
(**) ckb1: Corsair Gaming Sabre PRO RGB Mouse: (accel) acceleration factor: 2.000
(**) ckb1: Corsair Gaming Sabre PRO RGB Mouse: (accel) acceleration threshold: 4
(II) config/udev: Adding input device ckb1: Corsair Gaming Sabre PRO RGB Mouse (/dev/input/mouse0)
(II) No input driver specified, ignoring this device.
(II) This device may have been added with another device file.
xinput --test
我滚动时的输出是:
motion a[8]=-1 motion a[8]=-2 motion a[8]=-3 motion a[8]=-2 motion a[8]=-1 motion a[8]=0 motion a[8]=1 motion a[8]=2 motion a[8]=3 motion a[8]=4 motion a[8]=3 motion a[8]=2 motion a[8]=1 motion a[8]=0
答案1
衷心感谢这里和 Reddit 上的所有人,尤其是 @dirkt,感谢你们提供的所有帮助。最后,我选择了核选项:我清除了根分区并重新安装了 Linux。我的滚轮现在运行正常,并且解决了我遇到的其他一些问题。
对于遇到此类问题的大部分用户,我不建议这样做,尽管这样做确实有效。在彻底解决问题之前,请先尝试修复它(当然,请先备份所有数据)。
我现在使用的是 Linux Mint 18.2,使用默认的 4.8 内核。如果有人想知道现在相同的命令输出是什么,我可以用更多信息更新我的问题。
答案2
部分答案:
如您所见,滚轮事件显示正常。但 X evdev 驱动程序会感到困惑,因为它获取的信息是,与其对应的输入设备有很多轴、很多按钮,甚至还有按键(这就是为什么您会看到配置为键盘在日志中)。这就是它不会像平常一样将滚轮事件转换为按钮 4 和 5 按下的原因,因此应用程序也无法识别滚轮事件。
所以问题是为什么该设备声称有这么多输入。我怀疑当你evtest
运行很多支持类型 1 和 2 的事件。为了进行比较,下面是我使用鼠标获得的结果:
$ sudo evtest
...
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 272 (BTN_LEFT)
Event code 273 (BTN_RIGHT)
Event code 274 (BTN_MIDDLE)
Event type 2 (EV_REL)
Event code 0 (REL_X)
Event code 1 (REL_Y)
Event code 8 (REL_WHEEL)
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
您可能会获得从 0 到 8 的所有轴,也许还会获得所有键。
如果是这种情况,则表明内核驱动程序存在问题。请更新到最新内核,然后重试。
你的所有鼠标可能都是 HID 设备(一种标准化的 USB 输入协议)。如果更新内核不起作用,下一步就是检查 HID 描述符(参见注释这里以获得指导如何去做)来查看它是否正确,但这开始变得非常技术性。