I have noticed, that although my "Bluetooth Headset" works perfectly fine, buttons on it, like Previous, Next, Play etc do not.
Why is that?
I have noticed, that although my "Bluetooth Headset" works perfectly fine, buttons on it, like Previous, Next, Play etc do not.
Why is that?
As of Ubuntu 10.04, uinput
module that handles such buttons is not started by default. To fix the situation:
sudo service bluetooth stop
sudo modprobe uinput
sudo service bluetooth start
That should fix the issue temporarily, until restart. To fix it permanently, run:
echo 'uinput' | sudo tee -a /etc/modules
Vava's answer did not fix the issue for me alone (Ubuntu 20.04), I had to use, in addition, xbindkeys
and playerctl
https://wiki.archlinux.org/title/Xbindkeys
First, disable/unassign the shortcuts for media play and pause via the shortcut editor.
sudo apt install xbindkeys playerctl
xbindkeys -d > ~/.xbindkeysrc
Open ~/.xbindkeysrc
and delete all lines between line 40 and 66 inclusive.
xbindkeys --key
Get the raw keycode (e.g. m:0x0 + c:209
). Your headset might toggle between play and pause keycodes, so run xbindkeys --key
twice to get code for both play and pause.
Put the following into your ~/.xbindkeysrc with the correct key codes.
"playerctl play-pause"
m:0x0 + c:208t
"playerctl play-pause"
m:0x0 + c:209
If your headset is already passing XF86Play or some other key (you can use screenkey
to check, you can use the following instead as an example
"playerctl play-pause"
XF86AudioPlay
playerctl play-pause
will control "the first available player". Read playerctl -h
for more info/options if needed.
Open /etc/X11/Xsession
as root. Add the line xbindkeys
after the line PROGNAME=Xsession
.
Reboot.
My headset now correctly controls Youtube videos.
m:0x0 + c:208
for me instead of m:0x0 + c:208t
. I don't know much about keycodes, but if anyone runs into this issue, try changing the keycode like this and see if it works for you :D
– Suyog Jadhav
Sep 17 '22 at 22:20