onClientMTAFocusChange
Client-side
Server-side
Shared
This event is triggered every time the MTA window gains or loses focus.
Parameters
bool windowFocused
- windowFocused: A boolean, indicating whether the MTA window is focused or not.
Source
element: The source of this event is the root element.
Code Examples
client
This example prints message on chat with focus state:
function onClientMTAFocusChange(windowFocused) local focusedText = windowFocused and "MTA has gained focus." or "MTA has lost focus."
outputChatBox(focusedText)endaddEventHandler("onClientMTAFocusChange", root, onClientMTAFocusChange)
See Also
Other Events
- onClientChatMessage
- onClientConsole
- onClientCoreCommand
- onClientDebugMessage
- onClientExplosion
- onClientFileDownloadComplete
- onClientHUDRender
- onClientMTAFocusChange
- onClientMinimize
- onClientPedsProcessed
- onClientPlayerNetworkStatus
- onClientPreRender
- onClientRender
- onClientRestore
- onClientTransferBoxProgressChange
- onClientTransferBoxVisibilityChange
- onClientWorldSound