---
name: "inputMouse"
type: command
status: ok
groups: ["Interaction"]
arma3_since: "2.08"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/inputMouse
revid: 309128
updated: 2022-05-03T11:40:11Z
---

# inputMouse

*Command · Interaction · Arma 3 v2.08*

## Description

Returns the state of mouse button action, alone or in combination with key presses. For more information on codes and combos see Arma_3:_Modded_Keybinding and DIK_KeyCodes but here are some examples of how codes could be hand constructed:

- KEYBOARD_COMBO 16777216 (0x1000000)
- DEVICE_MOUSE 65536 (0x10000)
- HOLD_OFFSET 0
- CLICK_OFFSET 128 (0x80)
- DOUBLE_CLICK_OFFSET 256 (0x100)
- SPECIAL_COMBINATIONS 1114112 (0x110000)

```
Click + Hold: BUTTON + DEVICE_MOUSE + HOLD_OFFSET = BUTTON + 65536 + 0
Click: BUTTON + DEVICE_MOUSE + CLICK_OFFSET = BUTTON + 65536 + 128 
Double Click: BUTTON + DEVICE_MOUSE + DOUBLE_CLICK_OFFSET = BUTTON + 65536 + 256

RMB Click + Hold:  1 + 65536 + 0 = 65537
RMB Click: 1 + 65536 + 128 = 65665
RMB Double Click: 1 + 65536 + 256 = 65793

Combo + Click + Hold: DIK * KEYBOARD_COMBO + SPECIAL_COMBINATIONS + BUTTON + HOLD_OFFSET = DIK * 16777216 + 1114112 + BUTTON + 0
Combo + Click: DIK * KEYBOARD_COMBO + SPECIAL_COMBINATIONS + BUTTON + CLICK_OFFSET = DIK * 16777216 + 1114112 + BUTTON + 128
Combo + Double Click: DIK * KEYBOARD_COMBO + SPECIAL_COMBINATIONS + BUTTON + DOUBLE_CLICK_OFFSET = DIK * 16777216 + 1114112 + BUTTON + 256

LShift + RMB Click + Hold: 42 * 16777216 + 1114112 + 1 + 0 = 705757185
LShift + RMB Click: 42 * 16777216 + 1114112 + 1 + 128 = 705757313
LShift + RMB Double Click: 42 * 16777216 + 1114112 + 1 + 256 = 705757441
```

## Syntax

### Syntax 1

```sqf
inputMouse button
```

**Parameters:**

- `button`: [Number](../topics/Number.md) - button number 0..7: 0-LMB, 1-RMB, 2-MMB

**Returns:** [Number](../topics/Number.md) - the state of the button:
- 0 - released
- 1 - click
- 2 - click + hold
- 3 - double click
- 4 - double click + hold

### Syntax 2

```sqf
inputMouse combocode
```

**Parameters:**

- `combocode`: [String](../topics/String.md) - code or combination (see [actionKeys](../commands/actionKeys.md))

**Returns:** [Boolean](../topics/Boolean.md) - [true](../commands/true.md) if given code/combination detected, [false](../commands/false.md) otherwise

## Examples

### Example 1

State of the RMB:

```sqf
onEachFrame { hintSilent str inputMouse 1 };
```

### Example 2

Detect LCtrl + 2xRMB:

```sqf
onEachFrame { hintSilent str inputMouse "487653633" };
```

## See also

[inputController](../commands/inputController.md) · [inputAction](../commands/inputAction.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 — inputMouse](https://community.bistudio.com/wiki/inputMouse) (revision 309128).</sub>
