sdljava.event
Class SDLMouseMotionEvent

java.lang.Object
  extended by sdljava.event.SDLEvent
      extended by sdljava.event.SDLMouseMotionEvent

public class SDLMouseMotionEvent
extends SDLEvent

Simply put, a SDL_MOUSEMOTION type event occurs when a user moves the mouse within the application window or when SDL_WarpMouse is called. Both the absolute (x and y) and relative (xrel and yrel) coordinates are reported along with the current button states (state). The button state can be interpreted using the SDL_BUTTON macro (see SDL_GetMouseState).

If the cursor is hidden (SDL_ShowCursor(0)) and the input is grabbed (SDL_WM_GrabInput(SDL_GRAB_ON)), then the mouse will give relative motion events even when the cursor reaches the edge of the screen. This is currently only implemented on Windows and Linux/Unix-alikes.

Version:
$Id: SDLMouseMotionEvent.java,v 1.10 2005/02/10 04:19:45 ivan_ganza Exp $
Author:
Ivan Z. Ganza

Field Summary
(package private)  SDL_MouseMotionEvent swigMouseMotionEvent
          Reference to the SWIG generated
(package private)  int x
           
(package private)  int y
           
 
Fields inherited from class sdljava.event.SDLEvent
activeEvent, dummyEvent, exposeEvent, joyAxisEvent, joyBallEvent, joyButtonEvent, joyHatEvent, mouseButtonEvent, mouseMotionEvent, quitEvent, resizeEvent, SDL_ACTIVEEVENT, SDL_ACTIVEEVENTMASK, SDL_ADDEVENT, SDL_APPACTIVE, SDL_APPINPUTFOCUS, SDL_APPMOUSEFOCUS, SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT, SDL_BUTTON_WHEELDOWN, SDL_BUTTON_WHEELUP, SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL, SDL_DISABLE, SDL_ENABLE, SDL_GETEVENT, SDL_IGNORE, SDL_JOYAXISMOTION, SDL_JOYAXISMOTIONMASK, SDL_JOYBALLMOTION, SDL_JOYBALLMOTIONMASK, SDL_JOYBUTTONDOWN, SDL_JOYBUTTONDOWNMASK, SDL_JOYBUTTONUP, SDL_JOYBUTTONUPMASK, SDL_JOYEVENTMASK, SDL_JOYHATMOTION, SDL_JOYHATMOTIONMASK, SDL_KEYDOWN, SDL_KEYDOWNMASK, SDL_KEYUP, SDL_KEYUPMASK, SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONDOWNMASK, SDL_MOUSEBUTTONUP, SDL_MOUSEBUTTONUPMASK, SDL_MOUSEEVENTMASK, SDL_MOUSEMOTION, SDL_MOUSEMOTIONMASK, SDL_NOEVENT, SDL_PEEKEVENT, SDL_PRESSED, SDL_QUERY, SDL_QUIT, SDL_QUITMASK, SDL_RELEASED, SDL_SYSWMEVENT, SDL_SYSWMEVENTMASK, SDL_USEREVENT, SDL_VIDEOEXPOSE, SDL_VIDEOEXPOSEMASK, SDL_VIDEORESIZE, SDL_VIDEORESIZEMASK, sdlKeyboardEvent, swigEvent, sysWMEvent, userEvent
 
Constructor Summary
SDLMouseMotionEvent()
           
 
Method Summary
 MouseButtonState getState()
          The current button state
 SDL_MouseMotionEvent getSwigMouseMotionEvent()
          Gets the value of swigMouseMotionEvent
 int getType()
          The type of the this event
 int getWhich()
          Describe getWhich method here.
 int getX()
          The X co-ordinate
 int getXrel()
          The relative X motion
 int getY()
          The Y co-oridante
 int getYrel()
          THe relative Y motion
 void setSwigMouseMotionEvent(SDL_MouseMotionEvent argSwigMouseMotionEvent)
          Sets the value of swigMouseMotionEvent
 void setX(int newX)
           
 void setY(int newY)
           
 java.lang.String toString()
           
 
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

swigMouseMotionEvent

SDL_MouseMotionEvent swigMouseMotionEvent
Reference to the SWIG generated


x

int x

y

int y
Constructor Detail

SDLMouseMotionEvent

public SDLMouseMotionEvent()
Method Detail

getSwigMouseMotionEvent

public SDL_MouseMotionEvent getSwigMouseMotionEvent()
Gets the value of swigMouseMotionEvent

Returns:
the value of swigMouseMotionEvent

setSwigMouseMotionEvent

public void setSwigMouseMotionEvent(SDL_MouseMotionEvent argSwigMouseMotionEvent)
Sets the value of swigMouseMotionEvent

Parameters:
argSwigMouseMotionEvent - Value to assign to this.swigMouseMotionEvent

getWhich

public int getWhich()
Describe getWhich method here.

Returns:
a short value

getState

public MouseButtonState getState()
The current button state

Returns:
a short value

getX

public int getX()
The X co-ordinate

Returns:
an int value

setX

public void setX(int newX)

getY

public int getY()
The Y co-oridante

Returns:
an int value

setY

public void setY(int newY)

getXrel

public int getXrel()
The relative X motion

Returns:
a short value

getYrel

public int getYrel()
THe relative Y motion

Returns:
a short value

getType

public int getType()
The type of the this event

Specified by:
getType in class SDLEvent
Returns:
The type of event

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a String representation of myself