pynput
pynput copied to clipboard
uinput does not work when there's no mouse available
I'm on a headless raspi, with no X etc.
Because this library tries to resolve the backend at import time, it's currently impossible to use it with PYNPUT_BACKEND=uinput when there's no suitable mouse backend (even though I do not care about mouse support).
When commenting out the from . import mouse it works fine.
IMHO the checks for supported backends should only happen when you try to create a listener or similar, but not at import time. Alternatively allow setting something like PYNPUT_BACKEND_MOUSE=none to avoid failing with an exception when no mouse backend can be found