Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug (with idea for fix): no evdev devices if user is not in input #84

Open
Nielius opened this issue Dec 3, 2024 · 0 comments
Open

Comments

@Nielius
Copy link

Nielius commented Dec 3, 2024

Bug behavior: no key presses were being detected (but there were no errors, so at first sight, it looked like everything should work)

Root cause: evdev.list_devices returned an empty list, because my user didn't have the right permissions. I solved it by adding my user to the input group (with sudo usermod -aG input your-username-here), as suggested here on stackoverflow, and restarting my computer. To diagnose if this is the problem, you only need to run python -c "import evdev; print(evdev.list_devices())".


IMO a nice way to fix this would be to check in the code if evdev.list_devices returns an empty list (probably here:

self.devices = [evdev.InputDevice(path) for path in evdev.list_devices()]
), and if so, raise an exception with a possible solution (adding the user). Maybe we should also add this step to the installation instructions for Linux users.

If you like, I'd be happy to create a PR with this fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant