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?

2 Answers 2

2
  1. As a USB HID device.

  2. Via the event subsystem.

  3. Uh...

2
  • Thank you. With regards to recognizing a USB HID device, do I need to install drivers for the gamepad? Jul 4, 2012 at 15:45
  • No. All modern Linuxes have the USB HID driver already available, either built-in or as a module. Jul 4, 2012 at 15:47
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:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .