sdljava.event

Class 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
SDL_MouseMotionEventswigMouseMotionEvent
Reference to the SWIG generated
intx
inty
Method Summary
MouseButtonStategetState()
The current button state
SDL_MouseMotionEventgetSwigMouseMotionEvent()
Gets the value of swigMouseMotionEvent
intgetType()
The type of the this event
intgetWhich()
Describe getWhich method here.
intgetX()
The X co-ordinate
intgetXrel()
The relative X motion
intgetY()
The Y co-oridante
intgetYrel()
THe relative Y motion
voidsetSwigMouseMotionEvent(SDL_MouseMotionEvent argSwigMouseMotionEvent)
Sets the value of swigMouseMotionEvent
voidsetX(int newX)
voidsetY(int newY)
StringtoString()

Field Detail

swigMouseMotionEvent

SDL_MouseMotionEvent swigMouseMotionEvent
Reference to the SWIG generated

x

int x

y

int y

Method Detail

getState

public MouseButtonState getState()
The current button state

Returns: a short value

getSwigMouseMotionEvent

public SDL_MouseMotionEvent getSwigMouseMotionEvent()
Gets the value of swigMouseMotionEvent

Returns: the value of swigMouseMotionEvent

getType

public int getType()
The type of the this event

Returns: The type of event

getWhich

public int getWhich()
Describe getWhich method here.

Returns: a short value

getX

public int getX()
The X co-ordinate

Returns: an int value

getXrel

public int getXrel()
The relative X motion

Returns: a short value

getY

public int getY()
The Y co-oridante

Returns: an int value

getYrel

public int getYrel()
THe relative Y motion

Returns: a short value

setSwigMouseMotionEvent

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

Parameters: argSwigMouseMotionEvent Value to assign to this.swigMouseMotionEvent

setX

public void setX(int newX)

setY

public void setY(int newY)

toString

public String toString()

Returns: a String representation of myself