During my development, I have found 2 different crates that handles global key input. They are inputbot
and mki
. I looked at some issues in inputbot
and learnt that they are using libinput
as the backend. I didn’t read about mki
though.
This soundboard is using mki
, and global hotkey is working in Wayland (at least for Plasma).
Global hotkey is only used for playing the sounds and nothing else, and that is basically just running a command.
This will play all files that has an audio stream (cls is also using this command):
ffmpeg -i <file> -f s16le - | pacat -d <sink> --channels=<1 for mono, 2 for stereo> --rate=<sample rate> --volume=<0-65535, 65535 = 100%>
I guess it is pretty complicated so maybe I’ll add a way to play files.