Arma 3 Scripting

inputMouse

  • Arma 3 v2.08

Command · Markdown · JSON · original wiki page

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:

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

inputMouse button

Parameters:

Returns: Number - the state of the button:

Syntax 2

inputMouse combocode

Parameters:

Returns: Boolean - true if given code/combination detected, false otherwise

Examples

Example 1

State of the RMB:

onEachFrame { hintSilent str inputMouse 1 };

Example 2

Detect LCtrl + 2xRMB:

onEachFrame { hintSilent str inputMouse "487653633" };

See also

inputController · inputAction · actionKeys · actionKeysImages · actionKeysNames · actionIDs · actionParams · addAction · setUserActionText · inGameUISetEventHandler · showHUD · removeAction · removeAllActions · action