sdljava.joystick
Class HatState
java.lang.Object
sdljava.joystick.HatState
public class HatState
- extends java.lang.Object
Describe the state of a joystick hat.
- Version:
- $Id: HatState.java,v 1.4 2005/01/19 03:09:12 ivan_ganza Exp $
- Author:
- Ivan Z. Ganza
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SDL_HAT_CENTERED
public static final int SDL_HAT_CENTERED
- See Also:
- Constant Field Values
SDL_HAT_UP
public static final int SDL_HAT_UP
- See Also:
- Constant Field Values
SDL_HAT_RIGHT
public static final int SDL_HAT_RIGHT
- See Also:
- Constant Field Values
SDL_HAT_DOWN
public static final int SDL_HAT_DOWN
- See Also:
- Constant Field Values
SDL_HAT_LEFT
public static final int SDL_HAT_LEFT
- See Also:
- Constant Field Values
SDL_HAT_RIGHTUP
public static final int SDL_HAT_RIGHTUP
- See Also:
- Constant Field Values
SDL_HAT_RIGHTDOWN
public static final int SDL_HAT_RIGHTDOWN
- See Also:
- Constant Field Values
SDL_HAT_LEFTUP
public static final int SDL_HAT_LEFTUP
- See Also:
- Constant Field Values
SDL_HAT_LEFTDOWN
public static final int SDL_HAT_LEFTDOWN
- See Also:
- Constant Field Values
modCache
static java.util.Map modCache
- cache of HatState instances, one for each possible
mods values
state
int state
HatState
public HatState(int state)
get
public static HatState get(int state)
- Get the HatState instance identified by state. This method
creates the HatState instance and caches it if it didn't
already exist. Once created we won't need to create new
HatState object instances each time a keyboard event occurs.
- Parameters:
mods
- valid key mods (possibly OR'd together)
- Returns:
- The singleton HatState instance
hatCentered
public boolean hatCentered()
hatUp
public boolean hatUp()
hatRight
public boolean hatRight()
hatDown
public boolean hatDown()
hatLeft
public boolean hatLeft()
hatRightUp
public boolean hatRightUp()
hatRightDown
public boolean hatRightDown()
hatLeftUp
public boolean hatLeftUp()
hatLeftDown
public boolean hatLeftDown()
toString
public java.lang.String toString()
- Return a string represenation of this object
- Overrides:
toString
in class java.lang.Object
- Returns:
- a String represenation of this object