---
name: "BIS_fnc_keyHold"
type: function
status: ok
groups: ["Interaction"]
arma3_since: "1.00"
locality: {"argument": null, "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_keyHold
revid: 341362
updated: 2023-05-24T12:59:06Z
---

# BIS_fnc_keyHold

*Function · Interaction · Arma 3 v1.00*

Locality: effect **local** · executed with **spawn**

## Description

Allows for hold button interactions. Hold action is started by pressing <kbd>Space</kbd>.

## Syntax

```sqf
[description, duration, condition, arguments, loaded] spawn BIS_fnc_keyHold
```

**Parameters:**

- `description`: [String](../topics/String.md) - description of the performed action, displayed inside the progress bar.
- `duration`: [Number](../topics/Number.md) - (Optional, default 2) action duration
- `condition`: [Code](../topics/Code.md) or [String](../topics/String.md) - (Optional, default `{ true }`) condition that must be met for the action to display
- `arguments`: [Array](../topics/Array.md) - (Optional, default `[]`) arguments passed to the condition
- `loaded`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) defines if function is already loaded. This is handled by the function

**Returns:** - [spawn](../commands/spawn.md): [Script Handle](../topics/Script_Handle.md)
- [call](../commands/call.md): [true](../commands/true.md) if action was successful or [false](../commands/false.md) if it was interrupted.

## Examples

### Example 1

```sqf
["Hold that key!", 2, { alive player }] spawn BIS_fnc_keyHold;
```

### Example 2

Function can be called in [scheduled environment](../topics/Scheduler.md#scheduled_environment) to return values and be used for further code execution.

```sqf
0 spawn {
    private _success = ["Hold that key!", 2, { alive player }] call BIS_fnc_keyHold;
    if (_success) then { hint "Function executed" } else { hint "Function interrupted" };
};
```

## See also

[BIS_fnc_holdActionAdd](../functions/BIS_fnc_holdActionAdd.md) · [BIS_fnc_holdKey](../functions/BIS_fnc_holdKey.md)

<sub>Source: [BI Community Wiki — BIS fnc keyHold](https://community.bistudio.com/wiki/BIS_fnc_keyHold) (revision 341362).</sub>
