PINE64
Headphone media control - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: General Discussion on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=127)
+--- Thread: Headphone media control (/showthread.php?tid=16384)



Headphone media control - rmblror - 03-27-2022

Hi, does anyone know how to change the functionality of button presses on standard 3.5mm jack devices?

I have some headphones with a volume up/down and play/pause buttons that all work as expected. What I want to do is to copy the behavior on android of enabling a double or triple press of the play/pause button to skip forward or back in what I'm listening to. This alone would turn it into a real daily driver for me Smile


RE: Headphone media control - wibble - 03-27-2022

I think the kernel driver just maps the button to a key such as KEY_PLAYPAUSE using snd_jack_set_key. To do anything with double or triple clicks you would need either the application to detect and handle them, or a daemon like input-remapper to generate the key events for the alternate functions.
https://github.com/sezanzeb/input-remapper