You can install the bindings this way:
$ python3 -m pip install vinput
Please note on Linux, you need libxdo installed.
The simplest program is the following:
import vinput
l = vinput.EventListener(True)
l.start(print)
You can log mouse buttons and movements too:
import vinput
l = vinput.EventListener(True, True, True)
l.start(print, print, print)
If you feel this library has been helpful, please consider supporting me by donating through my Ko-Fi. Thank you!
This software is licensed under the AGPLv3 license, more info in the LICENSE file.