---
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: 379355
updated: 2026-10-30T23:55:30Z
---

# 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](../topics/inputAction~2Factions.md).
\
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)

## Community notes

**Worldeater** — 2010-10-15

This command also returns values other than 0 and 1 (like 0.02 or 1.3). Any value greater than zero usually signals that the key or button is pressed. [inputAction](../commands/inputAction.md) does not work reliably when used in RscDisplayMission's onKeyDown event handler (the same is probably true for other input related event handlers).

---

**FlannelMouth** — 2014-05-08

[inputAction](../commands/inputAction.md) does not return the actual state of the queried key when a dialog screen is open. Instead, it will always return 0.

---

**Waffle SS.** — 2015-07-31

**inputAction** is capable of returning the state of analog inputs. This includes mouse, joystick, and even TrackIR. A joystick axis will return a value from 0 to 1, while mouse movement returns the rate of change, which can be > 1.

Right mouse click is currently not supported, but right mouse hold is: https://feedback.bistudio.com/T83382

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