A Linux C++ joystick object

In this post we will implement an object in C++ for accessing the state of an attached joystick. Below is a rendering using SDL and OpenGL of a joystick state. In "/usr/include/linux/joystick.h" we find the following event structure: Once we have opened a device node for reading we will populate this event structure with the data read from the device. We define a structure for holding the state of the joystick. As we parse the event data, the joystick state structure is updated Read more [...]