pynput icon indicating copy to clipboard operation
pynput copied to clipboard

uinput does not work when there's no mouse available

Open ThiefMaster opened this issue 3 months ago • 0 comments

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

ThiefMaster avatar Sep 09 '25 23:09 ThiefMaster