[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] events with same value



On Fri, 2005-04-22 at 11:54 +0800, Simon Wittber wrote:
> import pygame
> print pygame.ACTIVEEVENT, pygame.HAT_UP

HAT_UP isn't an event type. You are looking for the JOYHATMOTION event.
SDL events return the hat position as a constant value. The JOYHATMOTION
events have an attribute named "value" which represents one of the HAT
directions.

For some reason my first thought was the hat value was translated into a
x and y axis pair. with 0,0 being centered and 1,0 representing right,
etc. That may be the case but I'm not looking at the code right now.