Mouse

Represent the Mouse

Members

Aliases

Cursor
alias Cursor = SDL_Cursor*

The Cursor representation

Enums

Button
enum Button

Supported mouse buttons

SystemCursor
enum SystemCursor

Possible System cursors

Static functions

captureCursor
void captureCursor(bool enable)

Capture the mouse and track input outside of an Window.

createCursor
Cursor createCursor(ref Surface srfc, int hx, int hy)

Create a Surface cursor.

createCursor
Cursor createCursor(SystemCursor cursor)

Create a system cursor.

enableRelativeMouse
bool enableRelativeMouse(bool enable)

Tries to enable/disable the relative mouse mode. While the mouse is in relative mode, the cursor is hidden, and the driver will try to report continuous motion in the current Window. Only relative motion events will be delivered, the mouse position will not change.

getCursor
Cursor getCursor()

Returns the active cursor.

getCursorPosition
Vector2i getCursorPosition()

Returns the current cursor position

getDefaultCursor
Cursor getDefaultCursor()

Get the default cursor.

getGlobalCursorPosition
Vector2i getGlobalCursorPosition()

Returns the global cursor position. x and y will be reported relative to the top-left of the Desktop

getRelativeCursorPosition
Vector2i getRelativeCursorPosition()

Returns the relative cursor position. x and y are set to the mouse deltas since the last call

hasRelativeMouse
bool hasRelativeMouse()

Returns if the Relative mouse mode is enabled/supported.

isPressed
bool isPressed(Button btn)

Returns if the given button is pressed.

setCursor
void setCursor(Cursor cursor)

Set the active cursor.

setCursorPosition
void setCursorPosition(int x, int y)

Set the cursor position inside the window.

setCursorPosition
void setCursorPosition(const Vector2i pos)

Set the cursor position inside the window.

setGlobalCursorPosition
void setGlobalCursorPosition(int x, int y)

Set the cursor position in global screen space.

setGlobalCursorPosition
void setGlobalCursorPosition(const Vector2i pos)

Set the cursor position in global screen space.

showCursor
void showCursor(bool enable)

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

Meta

Authors

Randy Schuett (rswhite4@googlemail.com)