sdl.mouse

SDL Mouse Handling

Members

Aliases

SDL_MouseID
alias SDL_MouseID = Uint32

This is a unique ID for a mouse for the time it is connected to the system, and is never reused for the lifetime of the application.

Enums

SDL_BUTTON_MASK
eponymoustemplate SDL_BUTTON_MASK(Uint32 X)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SDL_MouseButtonFlags
enum SDL_MouseButtonFlags

A bitmask of pressed mouse buttons, as reported by SDL_GetMouseState, etc.

SDL_MouseWheelDirection
enum SDL_MouseWheelDirection

Scroll direction types for the Scroll event

SDL_SystemCursor
enum SDL_SystemCursor

Cursor types for SDL_CreateSystemCursor().

Functions

SDL_CaptureMouse
bool SDL_CaptureMouse(bool enabled)

Capture the mouse and to track input outside an SDL window.

SDL_CreateColorCursor
SDL_Cursor* SDL_CreateColorCursor(SDL_Surface* surface, int hot_x, int hot_y)

Create a color cursor.

SDL_CreateCursor
SDL_Cursor* SDL_CreateCursor(Uint8* data, Uint8* mask, int w, int h, int hot_x, int hot_y)

Create a cursor using the specified bitmap data and mask (in MSB format).

SDL_CreateSystemCursor
SDL_Cursor* SDL_CreateSystemCursor(SDL_SystemCursor id)

Create a system cursor.

SDL_CursorVisible
bool SDL_CursorVisible()

Return whether the cursor is currently being shown.

SDL_DestroyCursor
void SDL_DestroyCursor(SDL_Cursor* cursor)

Free a previously-created cursor.

SDL_GetCursor
SDL_Cursor* SDL_GetCursor()

Get the active cursor.

SDL_GetDefaultCursor
SDL_Cursor* SDL_GetDefaultCursor()

Get the default cursor.

SDL_GetGlobalMouseState
SDL_MouseButtonFlags SDL_GetGlobalMouseState(float* x, float* y)

Query the platform for the asynchronous mouse button state and the desktop-relative platform-cursor position.

SDL_GetMice
SDL_MouseID* SDL_GetMice(int* count)

Get a list of currently connected mice.

SDL_GetMouseFocus
SDL_Window* SDL_GetMouseFocus()

Get the window which currently has mouse focus.

SDL_GetMouseNameForID
const(char)* SDL_GetMouseNameForID(SDL_MouseID instance_id)

Get the name of a mouse.

SDL_GetMouseState
SDL_MouseButtonFlags SDL_GetMouseState(float* x, float* y)

Query SDL's cache for the synchronous mouse button state and the window-relative SDL-cursor position.

SDL_GetRelativeMouseState
SDL_MouseButtonFlags SDL_GetRelativeMouseState(float* x, float* y)

Query SDL's cache for the synchronous mouse button state and accumulated mouse delta since last call.

SDL_GetWindowRelativeMouseMode
bool SDL_GetWindowRelativeMouseMode(SDL_Window* window)

Query whether relative mouse mode is enabled for a window.

SDL_HasMouse
bool SDL_HasMouse()

Return whether a mouse is currently connected.

SDL_HideCursor
bool SDL_HideCursor()

Hide the cursor.

SDL_SetCursor
bool SDL_SetCursor(SDL_Cursor* cursor)

Set the active cursor.

SDL_SetWindowRelativeMouseMode
bool SDL_SetWindowRelativeMouseMode(SDL_Window* window, bool enabled)

Set relative mouse mode for a window.

SDL_ShowCursor
bool SDL_ShowCursor()

Show the cursor.

SDL_WarpMouseGlobal
bool SDL_WarpMouseGlobal(float x, float y)

Move the mouse to the given position in global screen space.

SDL_WarpMouseInWindow
void SDL_WarpMouseInWindow(SDL_Window* window, float x, float y)

Move the mouse cursor to the given position within the window.

Manifest constants

SDL_BUTTON_LMASK
enum SDL_BUTTON_LMASK;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SDL_BUTTON_MMASK
enum SDL_BUTTON_MMASK;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SDL_BUTTON_RMASK
enum SDL_BUTTON_RMASK;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SDL_BUTTON_X1MASK
enum SDL_BUTTON_X1MASK;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
SDL_BUTTON_X2MASK
enum SDL_BUTTON_X2MASK;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Structs

SDL_Cursor
struct SDL_Cursor

The structure used to identify an SDL cursor.

See Also

Meta

License

Subject to the terms of the Zlib License, as written in the LICENSE file.

Authors

Luna Nielsen