Mouse

Represent the Mouse

Members

Aliases

Cursor
alias Cursor = SDL_Cursor*

Shorthand for SDL_Cursor*

warp
alias warp = setCursorPosition

Alias for setting cursor position

Enums

Button
enum Button

Supported mouse buttons

MotionStates
enum MotionStates

Supported mouse motion states

State
enum State

Supported mouse states

Static functions

create
Cursor create(Surface srfc, short x, short y)

Creates a cursor at the given positions with the given Surface.

create
Cursor create(ubyte* data, ubyte* mask, ushort width, ushort height, short x, short y)

Creates a cursor from pixel data.

destroyCursor
void destroyCursor(Cursor cursor)

Destroys the given cursor.

enableRelativeMouse
bool enableRelativeMouse(bool enable)

Tries to enable/disable the relative mouse mode.

getCursor
Cursor getCursor()

Returns the current cursor.

getCursorPosition
int[2] getCursorPosition()

Returns the cursor position as static array.

getRelativeState
uint getRelativeState(int* x, int* y)

Returns the relative mouse state and (if y and y aren't null) the relative position. This means the difference of the positions since the last call of this method.

getState
uint getState(int* x, int* y)

Returns the mouse state and (if y and y aren't null) the current position.

hasRelativeMouse
bool hasRelativeMouse()

Returns if the Relative mouse mode is enabled/supported.

hasRelativeState
bool hasRelativeState(Button btn)
hasState
bool hasState(Button btn)

Returns if the given button is pressed.

setCursor
void setCursor(Cursor cursor)

Set a new cursor.

setCursorPosition
void setCursorPosition(short x, short y)

Set the cursor position inside the window.

showCursor
void showCursor(bool enable)

Enable or disable that the cursor is shown on the window.

Meta