Stopping when others are listening
When an app is started that natively supports the input method, it would make sense to stop relaying input, otherwise we send input twice.
This happens with
- games (and steam) when using a gampad
- Kodi when using CEC
I am not entirely sure what would be the best way to support this, lsof comes to mind:
$ lsof /dev/input/event26
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
plasma-re 1112 apol 19r CHR 13,90 0t0 1211 /dev/input/event26
$ lsof /dev/input/event26
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
plasma-re 1112 apol 19r CHR 13,90 0t0 1211 /dev/input/event26
steam 6547 apol 111u CHR 13,90 0t0 1211 /dev/input/event26