1

I would like to use the Logitech F710 gamepad as an input device to a python program. I am using Ubuntu. I do not really know where to start, so here are a few questions:

  1. How does Ubuntu detect the gamepad?
  2. If the gamepad is recognized within Ubuntu, how would I interact with this device via a python script?
  3. If this is not easy to do in Ubuntu, how would I interact with the gamepad via a python script in Windows?
Robotnik
  • 2,645

2 Answers2

2
  1. As a USB HID device.

  2. Via the event subsystem.

  3. Uh...

1

Input devices register as /dev/input/eventX in Linux, to interact with them you have to open that pseudo file and read from it.

Example source code to do in from C can be downloaded via:

apt-get source evtest

Python Code can be found at:

Grumbel
  • 3,782