---
name: "actionKeys"
type: command
status: ok
groups: ["Interaction"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/actionKeys
revid: 330779
updated: 2022-11-01T16:06:07Z
---

# actionKeys

*Command · Interaction · Arma 3 v0.50 · introduced in Operation Flashpoint: Elite v1.00*

## Description

Returns [Array](../topics/Array.md) containing dikCodes of keys, buttons and combos assigned to the given user action. Action names could be found in config class ControllerSchemes or user action names or user profile, for example:

```cpp
keyWatch[] = { 24 };
```

To retrieve the value, use the property name without 'key':

```sqf
actionKeys "Watch"; // 24
```

In addition, some of the actions are also listed in here: inputAction/actions

## Syntax

### Syntax 1

```sqf
actionKeys userAction
```

**Parameters:**

- `userAction`: [String](../topics/String.md)

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

### Syntax 2

*since Arma3 2.08*

```sqf
actionKeys [userAction]
```

**Parameters:**

- `userAction`: [String](../topics/String.md)

**Returns:** [Array](../topics/Array.md) of [String](../topics/String.md)s

## Examples

### Example 1

```sqf
_arrayOfNumbers = actionKeys "ReloadMagazine";
```

### Example 2

From Arma 3 v2.08: 

```sqf
_arrayOfStrings = actionKeys ["ReloadMagazine"];
```

## See also

[actionKeysNames](../commands/actionKeysNames.md) · [actionKeysNamesArray](../commands/actionKeysNamesArray.md) · [actionKeysImages](../commands/actionKeysImages.md) · [actionName](../commands/actionName.md) · [inputAction](../commands/inputAction.md) · [addUserActionEventHandler](../commands/addUserActionEventHandler.md)

## Community notes

**AgentRev** — 2016-05-11

If an action key is configured with a modifier (e.g. "Right Ctrl + M" for "MiniMapToggle"), the DIK code returned by this command has a weird value, equivalent to the following:

Left Ctrl + Key = 486539264 + DIK
Left Shift + Key = 704643072 + DIK
Left Alt + Key = 939524096 + DIK
Right Ctrl + Key = -1660944384 + DIK
Right Shift + Key = 905969664 + DIK
Right Alt + Key = -1207959552 + DIK</sqf>

This increases the difficulty of accurately comparing key codes to actionKeys in [UI event handlers](../topics/User_Interface_Event_Handlers.md). Those strange numbers are probably due to bit flags being added to the DIK value by the game engine for easier storage in the ArmaProfile.

In case of mouse buttons, actionKeys will also return values that are different from those in "MouseButton" UI events:

LMB: MouseButton 0 = actionKeys 65536
RMB: MouseButton 1 = actionKeys 65665 (65536 + 1 + 128)
MMB: MouseButton 2 = actionKeys 65538 (65536 + 2)
4MB: MouseButton 3 = actionKeys 65539 (65536 + 3)
5MB: MouseButton 4 = actionKeys 65540 (65536 + 4)
The values above are valid for a right-handed mouse configuration, and may or may not differ for a left-handed config.

*Note edited by R3vo (talk) 13:04, 19 March 2021 (CET)*

---

**Commy2** — 2016-08-06

**The values described by AgentRev cannot be compared reliably.** All numbers in SQF are floats and those are only precise up to 7 digits.

```sqf
486539264 + 19 == 486539264 + 20 // returns true
```

The DIK codes for `LCtrl + R` and `LCtrl + T` are indistinguishable.

*Note edited by R3vo (talk) 13:04, 19 March 2021 (CET)*

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