Allows querying of current mouse status.
class SDLMouseState
state | Mouse button pression state |
x | Current mouse x positio |
xrel | Relative x movement with respect to last check |
y | Current mouse y positio |
yrel | Relative y movement with respect to last check |
PumpAndRefresh() | Peeks incoming events into SDL and then refresh current mouse position and status. |
Refresh() | Refresh current mouse position and status. |
Allows querying of current mouse status.
This class is used to wrap mouse event collection functions SDL_GetMouseState and SDL_GetRelativeMouseState.
To query the state of the mouse, it is necessary to create an instance of this class, and then call its refresh() method.
If the program doesn't call periodically event dispatching routines or if it doesn't pump events through SDL.PumpEvents, then it is necessary to use the pumpAndRefresh() method for the contents of this class to be updated.
Mouse button pression state
Current mouse x positio
Relative x movement with respect to last check
Current mouse y positio
Relative y movement with respect to last check
Peeks incoming events into SDL and then refresh current mouse position and status.
SDLMouseState.PumpAndRefresh( )
This method internally performs a SDL.PumpEvents call before calling the refresh method.
Refresh current mouse position and status.
SDLMouseState.Refresh( )
Use this method only if the program pumps events or waits for them regularly. Otherwise, use SDLMouseState.PumpAndRefresh.