v2025.6.2
All Bundles

Cursor

Mouse cursor operations

Operations

CaptureMouse

Capture the mouse and to track input outside an SDL window

function : CaptureMouse(enabled:Bool) ~ Int

Parameters

NameTypeDescription
enabledBooltrue to enable capturing, false to disable.

Return

TypeDescription
Int0 on success or -1 if not supported

GetGlobalMouseState

Retrieve the current global state of the mouse

function : GetGlobalMouseState(x:IntRef, y:IntRef) ~ Int

Parameters

NameTypeDescription
xIntRefcoordinate of the mouse cursor position relative to the focus window
yIntRefcoordinate of the mouse cursor position relative to the focus window

Return

TypeDescription
Intcurrent button state as a bitmask

GetGlobalMouseState

Retrieve the current global state of the mouse

function : GetGlobalMouseState(p:Point) ~ Int

Parameters

NameTypeDescription
pPointx and y coordinates of the mouse cursor position relative to the focus window

Return

TypeDescription
Intcurrent button state as a bitmask

GetMouseState

Retrieve the current state of the mouse

function : GetMouseState(x:IntRef, y:IntRef) ~ Int

Parameters

NameTypeDescription
xIntRefcoordinate of the mouse cursor position relative to the focus window
yIntRefcoordinate of the mouse cursor position relative to the focus window

Return

TypeDescription
Intcurrent button state as a bitmask

GetMouseState

Retrieve the current state of the mouse

function : GetMouseState(p:Point) ~ Int

Parameters

NameTypeDescription
pPointx and y coordinates of the mouse cursor position relative to the focus window

Return

TypeDescription
Intcurrent button state as a bitmask

WarpMouseGlobal

Move the mouse to the given position in global screen space

function : WarpMouseGlobal(x:Int, y:Int) ~ Int

Parameters

NameTypeDescription
xIntx coordinate
yInty coordinate

Return

TypeDescription
Int0 on success or a negative error code on failure