OnClientMTAFocusChange

From Multi Theft Auto: Wiki
Revision as of 09:33, 8 October 2022 by Srslyyyy (talk | contribs) (Add onClientMTAFocusChange by lopsi & CrosRoad95 (https://github.com/multitheftauto/mtasa-blue/pull/2371))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This event is triggered every time MTA gains or losts focus.

Parameters

boolean windowFocused
  • windowFocused: A boolean, indicating whether MTA is focused or not.

Source

The source of this event is the root element.

Example

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)
end
addEventHandler("onClientMTAFocusChange", root, onClientMTAFocusChange)

Requirements

This template will be deleted.

See Also

Client other events


Client event functions