Welcome to Approximate Engineering’s Python Game Controller Documentation!¶
This library simplified access to the axes and buttons on game controller hardware from Python. It was originally written to support my PiWars robots, and remains focused on similar projects, but can be used wherever game controller functionality is required. The current code only supports Linux based systems, including the Raspberry Pi.
Getting the code¶
You can install the code using pip, you’ll have to add a few native libraries first though:
$ sudo apt-get install python-dev python-pip gcc $ pip install approxeng.input
(The exact dependencies may vary depending on your operating system, they come from using evdev and having to compile that particular python module against whatever underlying libraries your OS is using). I strongly recommend using a virtual environment (virtualenv) so you don’t have to install python libraries as root.
The controller support code is written in Python, but relies on some underlying operating system functionality which is exclusive to Linux based computers like the Pi. As a result, it won’t work on Windows or OSX. If you need to handle joysticks on those platforms I recommend taking a look at PyGame, which includes joystick support amongst its other functionality.
To work with the code on other platforms you’ll want to clone it from GitHub, it’s available under the ASL, the same as almost everything Python based. Documentation (this site) is generated using Sphinx.
- Change Log
- Simple Usage
- Standard Names
- Pairing Controllers over Bluetooth
- Configuring Playstation 3 Controllers
- API Documentation
- Common APIs
- Binding - approxeng.input.selectbinder
- PlayStation 3 Controller Support
- PlayStation 4 Controller Support
- XBox-One S Controller Support
- Rock Candy Controller Support
- Steam Controller Support
- Wii Remote Pro Controller Support
- WiiMote Controller Support
- PiHut Controller Support
- Adding support for a new controller type
- Advanced Usage Guide