GuiSetInputActive
Jump to navigation
Jump to search
guiSetInputActive
Grants or releases mouse and keyboard input ownership for an RmlUi document.
Syntax
bool guiSetInputActive(int document, bool active [, string focusElementId])
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
document |
int |
yes | The document handle returned by guiCreateDocument.
|
active |
bool |
yes | True to capture UI input or false to return input to the game. |
focusElementId |
string |
no | Optional element ID to focus when input is activated. |
Returns
Returns true when the input state is changed; otherwise returns false.
Examples
Open a login panel and focus its username field:
guiShow(loginDocument)
guiSetInputActive(loginDocument, true, "username")
-- Release input before hiding the panel.
guiSetInputActive(loginDocument, false)
guiHide(loginDocument)
Notes
- Available only in client-side resource scripts.
- Input ownership is resource-scoped and integrates with native game-input consumption.
- Release input before destroying a document. Resource shutdown also releases owned input automatically.