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?
Asked
Active
Viewed 3,519 times
3 Answers
2
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.

cube
- 3,867
- 7
- 32
- 52
0
Now (2016+) there's a new sufficiently multiplatform Python module called "inputs" that you can find on GitHub or install from Pipy
It can read joysticks, controllers, keyboards and mices and seems to offer a good support for all their features, including vibration where available.

RobM
- 1,005
- 11
- 13