{"name":"isUIContext","operator":null,"title":"isUIContext","type":"command","url":"https://community.bistudio.com/wiki/isUIContext","revid":310464,"updated":"2022-05-06T10:49:54Z","groups":["GUI Control","Program Flow"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.76"}],"since":{"game":"arma3","name":"Arma 3","version":"1.76"},"arma3_since":"1.76","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns true if the script originated from some UI control event, for example from \"onButtonDown\" EH. Exists within parent scope and immediate child scopes.","syntaxes":[{"syntax":"isUIContext","since":null,"effect":null,"exec":null,"params":[],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"},"form":"nullary","operator":null,"left":null,"right":null}],"examples":[{"text":"```sqf\nif (isUIContext) then { hint \"UI control event\" };\n```","code":["if (isUIContext) then { hint \"UI control event\" };"]},{"text":"```sqf\n_button ctrlSetEventHandler [\"ButtonDown\", \"call { diag_log isUIContext }\"]; // outputs true\n```","code":["_button ctrlSetEventHandler [\"ButtonDown\", \"call { diag_log isUIContext }\"]; // outputs true"]},{"text":"```sqf\n_button ctrlSetEventHandler [\"ButtonDown\", \"0 spawn { diag_log isUIContext }\"]; // outputs false\n```","code":["_button ctrlSetEventHandler [\"ButtonDown\", \"0 spawn { diag_log isUIContext }\"]; // outputs false"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["canSuspend","isRemoteExecuted","isRemoteExecutedJIP","isGamePaused","isGameFocused","serverCommand"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: GUI Control","Command Group: Program Flow","Introduced with Arma 3 version 1.76","Scripting Commands"]}