How to read the gamepad joystick buttons on Linux

Source:
Compile with:
gcc joystick.c -o joystick
Turn off PS3 override:
sudo xinput set-prop "Sony PLAYSTATION(R)3 Controller" "Device Enabled" 0
Launch:
./joystick /dev/input/js0
Binary Linux x64:

No comments: