gfm



class  SDL2Mouse;

Holds SDL mouse state.


const pure nothrow bool  isButtonPressed(int mask);

Returns
true if a specific mouse button defined by mask is pressed
Example:
// Check if the left mouse button is pressed

if(_sdl2.mouse.isButtonPressed(SDL_BUTTON_LMASK))

...


const pure nothrow int  x();

Returns
X coordinate of mouse pointer.

const pure nothrow int  y();

Returns
Y coordinate of mouse pointer.

const pure nothrow int  lastDeltaX();

Returns
X relative movement on last motion event.

const pure nothrow int  lastDeltaY();

Returns
Y relative movement on last motion event.

const pure nothrow SDL_Point  position();

Returns
Coordinates of mouse pointer.

const pure nothrow SDL_Point  previousPosition();

Returns
Previous coordinates of mouse pointer. Useful in onMouseMove event callback.

nothrow int  wheelDeltaX();

Returns
How much was scrolled by X coordinate since the last call.

nothrow int  wheelDeltaY();

Returns
How much was scrolled by Y coordinate since the last call.

void  startCapture();

Use this function to capture the mouse and to track input outside an SDL window.

See Also
https://wiki.libsdl.org/SDL_CaptureMouse
Throws
SDL2Exception on error.

void  stopCapture();

Use this function to stop capturing the mouse.

See Also
https://wiki.libsdl.org/SDL_CaptureMouse
Throws
SDL2Exception on error.

class  SDL2Cursor;

Mouse cursor, can be created from custom bitmap or from system defaults.


this(SDL2 sdl2, SDL2Surface surface, int hotspotX, int hotspotY);

Creates a cursor from a SDL surface.

The surface should outlive this cursor, its ownership will not be taken.

See Also
http://wiki.libsdl.org/SDL_CreateColorCursor
Throws
SDL2Exception on error.

this(SDL2 sdl2, SDL_SystemCursor id);

Creates a system cursor.

See Also
http://wiki.libsdl.org/SDL_CreateSystemCursor
Throws
SDL2Exception on error.

static SDL2Cursor  getDefault(SDL2 sdl2);

Returns
Default cursor.
See Also
http://wiki.libsdl.org/SDL_GetDefaultCursor
Throws
SDL2Exception on error.

static SDL2Cursor  getCurrent(SDL2 sdl2);

Returns
Current cursor.
See Also
http://wiki.libsdl.org/SDL_GetCursor
Throws
SDL2Exception on error.

SDL_Cursor*  handle();

Returns
SDL  handle.