
我一直在嘗試在運行 Manjaro 17.1.10 的筆記型電腦上使用耳機上的暫停/播放按鈕 (Plantronics BackBeat Pro 2)。他們還有“下一個”和“上一個”按鈕,運行得非常好。我在 Spotify、Clementine 和 VLC 中嘗試過它們,結果相同。
我有讀過 Arch wiki 頁面:
從我發現的情況看來,我需要載入uinput
核心模組。我讀過的指南說它們應該放在兩個不同的地方,但沒有人解釋要放入什麼。
/etc/rc.conf
/etc/modules-load.d/uinput.conf \<-- (我認為這是用於舊方法?)
這是我在嘗試尋找它時得到的結果:
[ibro@ibro-pc ~]$ lsmo |grep uinput
bash: lsmo: command not found
[ibro@ibro-pc ~]$ lsmod |grep uinput
uinput 20480 1
[ibro@ibro-pc ~]$ grep uinput /proc/modules
uinput 20480 1 - Live 0xffffffffc048d000
[ibro@ibro-pc ~]$ grep uinput /proc/$(uname -r)/modules.builtin
grep: /proc/4.14.40-1-MANJARO/modules.builtin: No such file or directory
[ibro@ibro-pc ~]$ pulseaudio --version
pulseaudio 11.1
因此,假設這是問題,我需要弄清楚在哪裡添加以及如何添加uinput
如果不是其他任何問題的解決方案
我想在 Linux 中添加兩個額外的耳機功能支援。
- 取下時智慧暫停,戴上後繼續播放
- 主動聆聽模式:偵測到聲音時暫停音樂。
當我跑步時,這兩個都有與暫停/播放按鈕非常相似的輸出xev
KeyPress event, serial 35, synthetic NO, window 0x8800001,
root 0x16a, subw 0x0, time 13766406, (-871,191), root:(420,262),
state 0x0, keycode 209 (keysym 0x1008ff31, XF86AudioPause), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 35, synthetic NO, window 0x8800001,
root 0x16a, subw 0x0, time 13766437, (-871,191), root:(420,262),
state 0x0, keycode 209 (keysym 0x1008ff31, XF86AudioPause), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 35, synthetic NO, window 0x8800001,
root 0x16a, subw 0x0, time 13767016, (-871,191), root:(420,262),
state 0x0, keycode 208 (keysym 0x1008ff14, XF86AudioPlay), same_screen YES,
XKeysymToKeycode returns keycode: 172
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 35, synthetic NO, window 0x8800001,
root 0x16a, subw 0x0, time 13767047, (-871,191), root:(420,262),
state 0x0, keycode 208 (keysym 0x1008ff14, XF86AudioPlay), same_screen YES,
XKeysymToKeycode returns keycode: 172
XLookupString gives 0 bytes:
XFilterEvent returns: False
這是實際的鍵盤暫停/播放按鈕
FocusIn event, serial 34, synthetic NO, window 0x8800001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 34, synthetic NO, window 0x0,
keys: 2 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
FocusOut event, serial 34, synthetic NO, window 0x8800001,
mode NotifyGrab, detail NotifyAncestor
FocusOut event, serial 34, synthetic NO, window 0x8800001,
mode NotifyUngrab, detail NotifyPointer
FocusIn event, serial 34, synthetic NO, window 0x8800001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 34, synthetic NO, window 0x0,
keys: 2 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