We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I wrote a simple evdev program to read from a Nintendo Switch JoyCon and print out any buttons pressed.
from evdev import InputDevice, categorize, ecodes, KeyEvent device = InputDevice("/dev/input/event17") for event in device.read_loop(): if event.type == ecodes.EV_KEY: keyevent = categorize(event) if keyevent.keystate == KeyEvent.key_down: print(keyevent.keycode)
And when I run the program it has an output like this
['BTN_A', 'BTN_GAMEPAD', 'BTN_SOUTH'] BTN_C ['BTN_NORTH', 'BTN_X'] ['BTN_B', 'BTN_EAST'] BTN_THUMBR BTN_TR2 BTN_Z ['BTN_WEST', 'BTN_Y'] BTN_START BTN_MODE
But when I pressed the ZR button this happens
Traceback (most recent call last): File "test/button_lister.py", line 7, in <module> keyevent = categorize(event) File "/usr/lib/python3/dist-packages/evdev/util.py", line 46, in categorize return event_factory[event.type](event) File "/usr/lib/python3/dist-packages/evdev/events.py", line 97, in __init__ self.keycode = keys[event.code] # :todo: KeyError: 319
I am using Python version 3.5.2.
The text was updated successfully, but these errors were encountered:
This was mentioned with a suggested fix (and a pull request) in #75 (comment) maybe it can be merged one day.
Sorry, something went wrong.
Merge pull request #109 from TheMadScientist1234/master
52d5510
Fix crash when handling unknown keys #91
No branches or pull requests
I wrote a simple evdev program to read from a Nintendo Switch JoyCon and print out any buttons pressed.
And when I run the program it has an output like this
But when I pressed the ZR button this happens
I am using Python version 3.5.2.
The text was updated successfully, but these errors were encountered: