google-code-export / pyglet

Automatically exported from code.google.com/p/pyglet
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

gamepad cannot be found in linux #662

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In Linux plug in gamepad  
(http://gaming.logitech.com/product/f710-wireless-gamepad)
2. Try to get joysticks (pyglet.input.get_joysticks()
3. Result will be empty list [].

It happens because in function _create_joystick (pyglet/input/evdev.py) checks 
only joysticks buttons, but not gamepad.

I suppose in function _create_joystick that code:

        elif control._event_type == EV_KEY and \
             control._event_code == BTN_JOYSTICK:

should be look like this:

        elif control._event_code in (BTN_JOYSTICK, BTN_GAMEPAD):

(at least it worked on my linux)

Original issue reported on code.google.com by monax.ti...@gmail.com on 3 Sep 2013 at 6:52

GoogleCodeExporter commented 9 years ago
Here's patch, if it will help.

Original comment by monax.ti...@gmail.com on 3 Sep 2013 at 12:55

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision a8e640cab751.

Original comment by useboxnet on 21 Sep 2013 at 9:40

GoogleCodeExporter commented 9 years ago
Thanks a lot for the patch!

Original comment by useboxnet on 21 Sep 2013 at 9:41