Module: SDL2::Joystick::Hat

Defined in:
joystick.c,
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 =

Returns hat state: Center position. Equal to 0.

Returns:

  • (Integer)

    hat state: Center position. Equal to 0.

INT2NUM(SDL_HAT_CENTERED)
UP =

Returns hat state: Up position.

Returns:

  • (Integer)

    hat state: Up position.

INT2NUM(SDL_HAT_UP)
RIGHT =

Returns hat state: Right position.

Returns:

  • (Integer)

    hat state: Right position.

INT2NUM(SDL_HAT_RIGHT)
DOWN =

Returns hat state: Down position.

Returns:

  • (Integer)

    hat state: Down position.

INT2NUM(SDL_HAT_DOWN)
LEFT =

Returns hat state: Left position.

Returns:

  • (Integer)

    hat state: Left position.

INT2NUM(SDL_HAT_LEFT)
RIGHTUP =

Returns hat state: Right Up position. Equal to (RIGHT | UP).

Returns:

  • (Integer)

    hat state: Right Up position. Equal to (RIGHT | UP)

INT2NUM(SDL_HAT_RIGHTUP)
RIGHTDOWN =

Returns hat state: Right Down position. Equal to (RIGHT | DOWN).

Returns:

  • (Integer)

    hat state: Right Down position. Equal to (RIGHT | DOWN)

INT2NUM(SDL_HAT_RIGHTDOWN)
LEFTUP =

Returns hat state: Left Up position. Equal to (LEFT | UP).

Returns:

  • (Integer)

    hat state: Left Up position. Equal to (LEFT | UP)

INT2NUM(SDL_HAT_LEFTUP)
LEFTDOWN =

Returns hat state: Left Down position. Equal to (LEFT | DOWN).

Returns:

  • (Integer)

    hat state: Left Down position. Equal to (LEFT | DOWN)

INT2NUM(SDL_HAT_LEFTDOWN)