在我的笔记本电脑上,打开自动重复 ( xset r on
) 不起作用。在检查 的输出时xev
,似乎自动重复失败的原因是因为间歇性地按下了另一个键(尽管我没有按下任何键),这取消了自动重复当前按住的键。当没有按下任何键时,将持续重复记录以下事件:
KeyPress event, serial 33, synthetic NO, window 0x1200001,
root 0x123, subw 0x0, time 1652400, (-509,794), root:(455,814),
state 0x0, keycode 221 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 33, synthetic NO, window 0x1200001,
root 0x123, subw 0x0, time 1652400, (-509,794), root:(455,814),
state 0x0, keycode 221 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
似乎正在按下键码为 221 的键,即使实际上并未按下。
因此,是否可以完全禁用某个键码,使 xorg 根本接收不到来自该键码的按键信号?或者,是否可以使按键在按住时自动重复,无论是否按下另一个键?
更新:
运行后sudo evtest
,似乎当隐藏输出来自
/dev/input/event11 PEAQ WMI hotkeys
当没有按下任何东西时,似乎没有其他输入设备会发送事件。在 evtest 中检查键盘事件时,自动重复起作用。
xev
当没有按下任何按钮时运行几秒钟的完整输出:
Outer window is 0x1200001, inner window is 0x1200002
PropertyNotify event, serial 8, synthetic NO, window 0x1200001,
atom 0x27 (WM_NAME), time 1651733, state PropertyNewValue
PropertyNotify event, serial 9, synthetic NO, window 0x1200001,
atom 0x22 (WM_COMMAND), time 1651733, state PropertyNewValue
PropertyNotify event, serial 10, synthetic NO, window 0x1200001,
atom 0x28 (WM_NORMAL_HINTS), time 1651733, state PropertyNewValue
CreateNotify event, serial 11, synthetic NO, window 0x1200001,
parent 0x1200001, window 0x1200002, (10,10), width 50, height 50
border_width 4, override NO
PropertyNotify event, serial 14, synthetic NO, window 0x1200001,
atom 0x15c (WM_PROTOCOLS), time 1651734, state PropertyNewValue
MapNotify event, serial 15, synthetic NO, window 0x1200001,
event 0x1200001, window 0x1200002, override NO
ReparentNotify event, serial 28, synthetic NO, window 0x1200001,
event 0x1200001, window 0x1200001, parent 0x4000d5,
(0,0), override NO
ConfigureNotify event, serial 28, synthetic NO, window 0x1200001,
event 0x1200001, window 0x1200001, (2,0), width 952, height 1033,
border_width 2, above 0x0, override NO
PropertyNotify event, serial 28, synthetic NO, window 0x1200001,
atom 0x15e (WM_STATE), time 1651735, state PropertyNewValue
MapNotify event, serial 28, synthetic NO, window 0x1200001,
event 0x1200001, window 0x1200001, override NO
VisibilityNotify event, serial 28, synthetic NO, window 0x1200001,
state VisibilityUnobscured
Expose event, serial 28, synthetic NO, window 0x1200001,
(0,0), width 952, height 10, count 3
Expose event, serial 28, synthetic NO, window 0x1200001,
(0,10), width 10, height 58, count 2
Expose event, serial 28, synthetic NO, window 0x1200001,
(68,10), width 884, height 58, count 1
Expose event, serial 28, synthetic NO, window 0x1200001,
(0,68), width 952, height 965, count 0
ConfigureNotify event, serial 28, synthetic YES, window 0x1200001,
event 0x1200001, window 0x1200001, (962,18), width 952, height 1033,
border_width 2, above 0x0, override NO
FocusIn event, serial 28, synthetic NO, window 0x1200001,
mode NotifyNormal, detail NotifyNonlinear
KeymapNotify event, serial 28, synthetic NO, window 0x0,
keys: 4294967236 0 0 0 16 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PropertyNotify event, serial 28, synthetic NO, window 0x1200001,
atom 0x14f (_NET_WM_DESKTOP), time 1651736, state PropertyNewValue
KeyRelease event, serial 30, synthetic NO, window 0x1200001,
root 0x123, subw 0x0, time 1651775, (-509,794), root:(455,814),
state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
XLookupString gives 1 bytes: (0d) "
"
XFilterEvent returns: False
MappingNotify event, serial 33, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 33, synthetic NO, window 0x1200001,
root 0x123, subw 0x0, time 1652400, (-509,794), root:(455,814),
state 0x0, keycode 221 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 33, synthetic NO, window 0x1200001,
root 0x123, subw 0x0, time 1652400, (-509,794), root:(455,814),
state 0x0, keycode 221 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 34, synthetic NO, window 0x1200001,
root 0x123, subw 0x0, time 1653200, (-509,794), root:(455,814),
state 0x0, keycode 221 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 34, synthetic NO, window 0x1200001,
root 0x123, subw 0x0, time 1653200, (-509,794), root:(455,814),
state 0x0, keycode 221 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 34, synthetic NO, window 0x1200001,
root 0x123, subw 0x0, time 1654000, (-509,794), root:(455,814),
state 0x0, keycode 221 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 34, synthetic NO, window 0x1200001,
root 0x123, subw 0x0, time 1654000, (-509,794), root:(455,814),
state 0x0, keycode 221 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 34, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 34, synthetic NO, window 0x1200001,
root 0x123, subw 0x0, time 1654760, (-509,794), root:(455,814),
state 0x0, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 35, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 35, synthetic NO, window 0x1200001,
root 0x123, subw 0x0, time 1654800, (-509,794), root:(455,814),
state 0x40, keycode 221 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 35, synthetic NO, window 0x1200001,
root 0x123, subw 0x0, time 1654800, (-509,794), root:(455,814),
state 0x40, keycode 221 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 36, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
FocusOut event, serial 36, synthetic NO, window 0x1200001,
mode NotifyGrab, detail NotifyAncestor
ClientMessage event, serial 37, synthetic YES, window 0x1200001,
message_type 0x15c (WM_PROTOCOLS), format 32, message 0x15d (WM_DELETE_WINDOW)
答案1
看来这是内核 4.13 引入的一个错误,根据Redhat bugzilla 错误 #1497861。
我发现卸载peaq_wmi
模块也是一种解决方法;似乎有人已经提交了补丁来解决这个问题。
(要卸载peaq_wmi
模块,可以发出命令sudo modprobe -r peaq_wmi
。)
答案2
事实证明,禁用 PEAQ WMI 热键可以修复该问题。我通过首先检查禁用 PEAQ WMI 热键xinput list
来查找 id:
[email protected]:~$ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Dell Dell KM632 Wireless Keyboard and Mouse id=11 [slave pointer (2)]
⎜ ↳ Dell Dell KM632 Wireless Keyboard and Mouse id=12 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=16 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Video Bus id=8 [slave keyboard (3)]
↳ Sleep Button id=9 [slave keyboard (3)]
↳ Dell Dell KM632 Wireless Keyboard and Mouse id=10 [slave keyboard (3)]
↳ Lenovo EasyCamera: Lenovo EasyC id=13 [slave keyboard (3)]
↳ Ideapad extra buttons id=14 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=15 [slave keyboard (3)]
↳ Dell Dell KM632 Wireless Keyboard and Mouse id=18 [slave keyboard (3)]
↳ PEAQ WMI hotkeys id=17 [slave keyboard (3)]
在本例中,id 是 17。然后,在 .xinitrc 中,我添加了xinput --disable 17
, 或引起问题的 id,这解决了问题。
答案3
最新内核更新后,我在elementaryOS 上遇到了同样的问题。我发布了有关它的信息这里。使用答案之一,sudo modprobe -r peaq_wmi
为我解决了这个问题。
编辑:添加xinput --disable 17
到 .xinit 中不是为我永久解决这个问题,所以我在每次启动后运行上面的命令。我的 Lenovo Yoga 500-14IHW 运行在elementaryOS 上。
另外,这个bug与Arch linux无关,所以请标记它,以便更多的人找到这个问题的解决方案。