|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sdljava.event.MouseButtonState
public class MouseButtonState
The current state of the mouse buttons.
Field Summary | |
---|---|
(package private) int |
buttons
Current button state values (possibly ORed together) |
(package private) static java.util.Map |
buttonStateCache
cache of MouseButtonState instances, one for each possible mods values |
static int |
SDL_BUTTON_LEFT
|
static int |
SDL_BUTTON_MIDDLE
|
static int |
SDL_BUTTON_RIGHT
|
static int |
SDL_BUTTON_WHEELDOWN
|
static int |
SDL_BUTTON_WHEELUP
|
Constructor Summary | |
---|---|
protected |
MouseButtonState(int buttons)
Creates a new MouseButtonState instance. |
Method Summary | |
---|---|
(package private) int |
button(int x)
|
boolean |
buttonLeft()
Get if the left mouse button is pressed |
boolean |
buttonMiddle()
Get if the middle mouse button is pressed |
boolean |
buttonRight()
Get if the right mouse button is pressed |
static MouseButtonState |
get(int buttons)
Get the MouseButtonState instance identified by mods. |
int |
getState()
|
java.lang.String |
toString()
Return a string represenation of this object |
boolean |
wheelDown()
Get if the wheel is down |
boolean |
wheelUp()
Get if the wheel is up |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int SDL_BUTTON_LEFT
public static final int SDL_BUTTON_MIDDLE
public static final int SDL_BUTTON_RIGHT
public static final int SDL_BUTTON_WHEELUP
public static final int SDL_BUTTON_WHEELDOWN
static java.util.Map buttonStateCache
int buttons
Constructor Detail |
---|
protected MouseButtonState(int buttons)
MouseButtonState
instance.
buttons
- an int
valueMethod Detail |
---|
public static MouseButtonState get(int buttons)
mods
- valid button state (possibly OR'd together)
public boolean buttonLeft()
public boolean buttonMiddle()
public boolean buttonRight()
public boolean wheelUp()
public boolean wheelDown()
public int getState()
final int button(int x)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |