-
Gamepad
A simple library for getting game controller and joystick inputs into Python in Linux. (by piborg)
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
The great article "Talking to gamepads from Python" explains step-by-step how a joystick or game controller is registered in Linux and how to systematically build a controller scheme. It starts by connecting the controller (see the section before) and accessing the controller with the generic HID interface via a library such as hidapi: Enumerate the API, note the controller ID, and access it. Here is a simple code example:
The final library is Piborg Gamepad. This library focuses on gamepad for video game consoles. It provides custom mappings for controllers with concrete button names, and it can simultaneously read the values of all gamepad axis (this is e.g. the digital pad and analog stick on a PlayStation pad). This library also supports two different programming model: You can define a global state that will be updated continuously in the background, or define event listeners that are processed when a button is pressed that trigger. The only caveat: The last commit is from 2019. Here is an example: