How can I use an analog joystick in Python on Linux? I come from a C++ background, where I used joystick.h to read events from /dev/input/js[x]. Is there a python wrapper around this I can use, perhaps? I don't really want to have to use a huge library like pyGame or SDL?
-
I don't know if it's the same interface, but this might be what you're looking for. sourceforge.net/projects/joy2xevHaz– Haz2013年08月19日 21:20:54 +00:00Commented Aug 19, 2013 at 21:20
3 Answers 3
This gist worked for me on Ubuntu 15.04 without modification.
Comments
There is evdev, It's only for Linux, and it seems to be able to do much more than just handling joystick. I've never tried it, though.
I spent some time looking for a library to only read joystick in a cross-platform way, but didn't find any, and I've ended up with pygame (only initializing joystick and event modules) in my projects.