我遇到了重複按鍵的問題。當我在鍵盤上使用媒體鍵時,例如暫停(為此我必須實際按兩個鍵,其中一個在 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 毫秒,即半秒。對於非殘疾人來說,有足夠的時間按下和釋放暫停鍵而不會觸發重複。您的值可能在某個時候被設定為非常低的值。但是,如果涉及預設時間不起作用的能力問題,則嘗試增加“延遲”值,或完全將其關閉。