|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsdljava.event.SDLEvent
sdljava.event.SDLMouseButtonEvent
public class SDLMouseButtonEvent
When a mouse button press or release is detected then number of the button pressed (from 1 to 255, with 1 usually being the left button and 2 the right) is placed into button, the position of the mouse when this event occured is stored in the x and the y fields. Like SDL_KeyboardEvent, information on whether the event was a press or a release event is stored in both the type and state fields, but this should be obvious.
Mouse wheel events are reported as buttons 4 (up) and 5 (down). Two events are generated i.e. you get a SDL_MOUSEBUTTONDOWN followed by a SDL_MOUSEBUTTONUP event.
| Field Summary | |
|---|---|
(package private) SDL_MouseButtonEvent |
swigMouseButtonEvent
Reference to the SWIG generated |
| Constructor Summary | |
|---|---|
SDLMouseButtonEvent()
|
|
| Method Summary | |
|---|---|
int |
getButton()
The mouse button index (SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT, SDL_BUTTON_WHEELUP, SDL_BUTTON_WHEELDOWN) |
SDLPressedState |
getState()
Get the state of the button |
SDL_MouseButtonEvent |
getSwigMouseButtonEvent()
Gets the value of swigMouseButtonEvent |
int |
getType()
The type of the this event |
int |
getWhich()
Describe getWhich method here. |
int |
getX()
The X co-oridnate |
int |
getY()
The Y co-ordinate |
void |
setSwigMouseButtonEvent(SDL_MouseButtonEvent argSwigMouseButtonEvent)
Sets the value of swigMouseButtonEvent |
java.lang.String |
toString()
|
java.lang.String |
translateButton(int button)
Get string represenation of button value |
| Methods inherited from class sdljava.event.SDLEvent |
|---|
enableKeyRepeat, enableUNICODE, eventState, getAppState, getKeyName, getModState, getMouseState, getRelativeMouseState, joystickEventState, pollEvent, pollEvent, processEvent, pumpEvents, setModState, waitEvent, waitEvent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
SDL_MouseButtonEvent swigMouseButtonEvent
| Constructor Detail |
|---|
public SDLMouseButtonEvent()
| Method Detail |
|---|
public SDL_MouseButtonEvent getSwigMouseButtonEvent()
public void setSwigMouseButtonEvent(SDL_MouseButtonEvent argSwigMouseButtonEvent)
argSwigMouseButtonEvent - Value to assign to this.swigMouseButtonEventpublic int getWhich()
getWhich method here.
short valuepublic int getButton()
short valuepublic SDLPressedState getState()
public int getX()
int valuepublic int getY()
int valuepublic int getType()
getType in class SDLEventpublic java.lang.String translateButton(int button)
button - an int value
public java.lang.String toString()
toString in class java.lang.ObjectString representation of myself
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||