Module: SDL2::Joystick::Hat

Defined in:
ext/sdl2_ext/joystick.c,
ext/sdl2_ext/joystick.c

Overview

This module provides constants of joysticks’s hat positions used by SDL2::Joystick class. The position of the hat is represented by OR’d bits of RIGHT, LEFT, UP, and DOWN. This means the center position (CENTERED) is represeted by 0 and the left up position LEFTUP is represeted by (LEFT|UP).

Constant Summary collapse

CENTERED =

Center position. Equal to 0.

INT2NUM(SDL_HAT_CENTERED)
UP =

Up position.

INT2NUM(SDL_HAT_UP)
RIGHT =

Right position.

INT2NUM(SDL_HAT_RIGHT)
DOWN =

Down position.

INT2NUM(SDL_HAT_DOWN)
LEFT =

Left position.

INT2NUM(SDL_HAT_LEFT)
RIGHTUP =

Right Up position. Equal to (RIGHT | UP)

INT2NUM(SDL_HAT_RIGHTUP)
RIGHTDOWN =

Right Down position. Equal to (RIGHT | DOWN)

INT2NUM(SDL_HAT_RIGHTDOWN)
LEFTUP =

Left Up position. Equal to (LEFT | UP)

INT2NUM(SDL_HAT_LEFTUP)
LEFTDOWN =

Left Down position. Equal to (LEFT | DOWN)

INT2NUM(SDL_HAT_LEFTDOWN)