---
name: "inputAction"
type: command
status: ok
groups: ["Interaction"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/inputAction
revid: 369187
updated: 2024-09-03T10:34:46Z
---

# inputAction

*Command · Interaction · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

Return the state of input devices mapped to given input action.

For Arma 3 inputActions and its bindings see: inputAction/actions.

For earlier Arma editions  see Category:Key Actions.

## Syntax

```sqf
inputAction name
```

**Parameters:**

- `name`: [String](../topics/String.md) - name of the action

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

## Examples

### Example 1

```sqf
inputAction "leanLeft";
```

 Returns 1 if the button mapped to "leanLeft" is pressed currently else 0.

### Example 2

```sqf
0 spawn {
    waitUntil {inputAction "reloadMagazine" > 0};
    hint "Reload Key Pressed";
};
```

## See also

[inputMouse](../commands/inputMouse.md) · [inputController](../commands/inputController.md) · [actionKeys](../commands/actionKeys.md) · [actionKeysImages](../commands/actionKeysImages.md) · [actionKeysNames](../commands/actionKeysNames.md) · [actionIDs](../commands/actionIDs.md) · [actionParams](../commands/actionParams.md) · [addAction](../commands/addAction.md) · [setUserActionText](../commands/setUserActionText.md) · [inGameUISetEventHandler](../commands/inGameUISetEventHandler.md) · [showHUD](../commands/showHUD.md) · [removeAction](../commands/removeAction.md) · [removeAllActions](../commands/removeAllActions.md) · [action](../commands/action.md)

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