GuiFocus
Jump to navigation
Jump to search
guiFocus
Moves keyboard focus to an element in an RML document.
Syntax
bool guiFocus(DocumentHandle document, string elementId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
document |
DocumentHandle |
yes | The owning document. |
elementId |
string |
yes | The element that should receive focus. |
Returns
Returns true when focus is applied; otherwise returns false.
Examples
Focus the chat input after opening chat:
guiShow(chatDocument)
guiFocus(chatDocument, "chat-input")
Notes
- Available only in client-side resource scripts.