Reputation: 195
Is pygame (pygame.locals.JOYHATMOTION) able to catch all directions from a gamepad with 8 way d-pad? I mean function get_hat, that returns tuples.
Upvotes: 0
Views: 1684
Reputation: 74645
Yes, http://www.pygame.org/docs/ref/joystick.html#Joystick.get_hat says it can handle an 8 directional pad.
the possible return values of get_hat
are in the following list:
>>> [(x,y) for x in [-1,0,1] for y in [-1,0,1]]
[(-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 0), (0, 1), (1, -1), (1, 0), (1, 1)]
Upvotes: 1