[SDL] Impending joystick changes

Sam Lantinga slouken at devolution.com
Tue Apr 4 15:51:09 PDT 2000


Some joystick API changes:

        The joystick hat position constants have been changed:
        Old constant            New constant
        ------------            ------------
             0                  SDL_HAT_CENTERED
             1                  SDL_HAT_UP
             2                  SDL_HAT_RIGHTUP
             3                  SDL_HAT_RIGHT
             4                  SDL_HAT_RIGHTDOWN
             5                  SDL_HAT_DOWN
             6                  SDL_HAT_LEFTDOWN
             7                  SDL_HAT_LEFT
             8                  SDL_HAT_LEFTUP
        The new constants are bitmasks, so you can check for the
        individual axes like this:
                if ( hat_position & SDL_HAT_UP ) {
                }
        and you'll catch left-up, up, and right-up.

I'll be committing this to CVS very soon.

See ya!
	-Sam Lantinga, Lead Programmer, Loki Entertainment Software



More information about the SDL mailing list