util.input.set_cursor_mode

Client

Sets the cursor visibility and confinement mode


Syntax

local status = util.input.set_cursor_mode(
    mode
)

Parameters

TypeNameDescription
util.input.cursor_modemodeTarget cursor mode to apply

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Capture the cursor for FPS camera control
util.input.set_cursor_mode(util.input.cursor_mode.CAPTURED)
Restore the cursor when opening a menu
util.input.set_cursor_mode(util.input.cursor_mode.VISIBLE)
Hide the cursor while still allowing free movement
util.input.set_cursor_mode(util.input.cursor_mode.HIDDEN)

On this page