我遇到了重复按键的问题。当我使用键盘上的媒体键时,例如暂停(实际上我必须按两个键,一个在 alt 键的右侧,我将把它称为修饰键,另一个是 F7),发送到媒体播放器的暂停命令会重复,从而导致暂停/播放循环。这显然是不可取的。如果我非常快速地按下按键,我可以避免重复,但我无法始终掌握正确的时间。我认为这与重复的修饰键以及发送命令后未释放修饰键有关。以下是输出xev
:
Outer window is 0x5200001, inner window is 0x5200002
...
MappingNotify event, serial 37, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyRelease event, serial 37, synthetic NO, window 0x5200001,
root 0x506, subw 0x0, time 16607317, (714,467), root:(864,619),
state 0x10, keycode 248 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
FocusOut event, serial 37, synthetic NO, window 0x5200001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 38, synthetic NO, window 0x5200001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 38, synthetic NO, window 0x0,
keys: 6 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 0 0 0 0
KeyPress event, serial 38, synthetic NO, window 0x5200001,
root 0x506, subw 0x0, time 16607493, (714,467), root:(864,619),
state 0x10, keycode 248 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 38, synthetic NO, window 0x5200001,
root 0x506, subw 0x0, time 16607995, (714,467), root:(864,619),
state 0x10, keycode 248 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 38, synthetic NO, window 0x5200001,
root 0x506, subw 0x0, time 16607995, (714,467), root:(864,619),
state 0x10, keycode 248 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 38, synthetic NO, window 0x5200001,
root 0x506, subw 0x0, time 16608025, (714,467), root:(864,619),
state 0x10, keycode 248 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 38, synthetic NO, window 0x5200001,
root 0x506, subw 0x0, time 16608025, (714,467), root:(864,619),
state 0x10, keycode 248 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 38, synthetic NO, window 0x5200001,
root 0x506, subw 0x0, time 16608056, (714,467), root:(864,619),
state 0x10, keycode 248 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
...
并且 KeyPress/KeyRelease 会重复,直到我按下另一个键。
那么,我该如何解决这个问题,同时保持任何“正常”键上的重复功能处于启用状态?我使用 ubuntu 19.04
答案1
可以自定义延迟和速度单独的按键只有在可能的情况下,才不向用户显示。但是,可以在“设置”中的“通用访问”下找到键盘延迟和速度的常规设置。单击“重复键”。将出现一个对话框,允许您调整“延迟”(即,您需要按住该键多长时间才能开始重复)和速度(即,该键重复的速度)。
“延迟”的默认值为 500 毫秒,即半秒。对于非残疾人士来说,这段时间足以按下并释放暂停键而不会触发重复。您的值可能在某个时候被设置为非常低的值。但是,如果涉及默认时间不起作用的能力问题,请尝试增加延迟值,或将其完全关闭。