---
name: "isUIContext"
type: command
status: ok
groups: ["GUI Control", "Program Flow"]
arma3_since: "1.76"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/isUIContext
revid: 310464
updated: 2022-05-06T10:49:54Z
---

# isUIContext

*Command · GUI Control, Program Flow · Arma 3 v1.76*

## Description

Returns [true](../commands/true.md) if the script originated from some UI control event, for example from "onButtonDown" EH. Exists within parent scope and immediate child scopes.

## Syntax

```sqf
isUIContext
```

**Returns:** [Boolean](../topics/Boolean.md)

## Examples

### Example 1

```sqf
if (isUIContext) then { hint "UI control event" };
```

### Example 2

```sqf
_button ctrlSetEventHandler ["ButtonDown", "call { diag_log isUIContext }"]; // outputs true
```

### Example 3

```sqf
_button ctrlSetEventHandler ["ButtonDown", "0 spawn { diag_log isUIContext }"]; // outputs false
```

## See also

[canSuspend](../commands/canSuspend.md) · [isRemoteExecuted](../commands/isRemoteExecuted.md) · [isRemoteExecutedJIP](../commands/isRemoteExecutedJIP.md) · [isGamePaused](../commands/isGamePaused.md) · [isGameFocused](../commands/isGameFocused.md) · [serverCommand](../commands/serverCommand.md)

<sub>Source: [BI Community Wiki — isUIContext](https://community.bistudio.com/wiki/isUIContext) (revision 310464).</sub>
