{"name":"inputMouse","operator":null,"title":"inputMouse","type":"command","url":"https://community.bistudio.com/wiki/inputMouse","revid":309128,"updated":"2022-05-03T11:40:11Z","groups":["Interaction"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.08"}],"since":{"game":"arma3","name":"Arma 3","version":"2.08"},"arma3_since":"2.08","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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:\n\n- KEYBOARD_COMBO 16777216 (0x1000000)\n- DEVICE_MOUSE 65536 (0x10000)\n- HOLD_OFFSET 0\n- CLICK_OFFSET 128 (0x80)\n- DOUBLE_CLICK_OFFSET 256 (0x100)\n- SPECIAL_COMBINATIONS 1114112 (0x110000)\n\n```\nClick + Hold: BUTTON + DEVICE_MOUSE + HOLD_OFFSET = BUTTON + 65536 + 0\nClick: BUTTON + DEVICE_MOUSE + CLICK_OFFSET = BUTTON + 65536 + 128 \nDouble Click: BUTTON + DEVICE_MOUSE + DOUBLE_CLICK_OFFSET = BUTTON + 65536 + 256\n\nRMB Click + Hold:  1 + 65536 + 0 = 65537\nRMB Click: 1 + 65536 + 128 = 65665\nRMB Double Click: 1 + 65536 + 256 = 65793\n\nCombo + Click + Hold: DIK * KEYBOARD_COMBO + SPECIAL_COMBINATIONS + BUTTON + HOLD_OFFSET = DIK * 16777216 + 1114112 + BUTTON + 0\nCombo + Click: DIK * KEYBOARD_COMBO + SPECIAL_COMBINATIONS + BUTTON + CLICK_OFFSET = DIK * 16777216 + 1114112 + BUTTON + 128\nCombo + Double Click: DIK * KEYBOARD_COMBO + SPECIAL_COMBINATIONS + BUTTON + DOUBLE_CLICK_OFFSET = DIK * 16777216 + 1114112 + BUTTON + 256\n\nLShift + RMB Click + Hold: 42 * 16777216 + 1114112 + 1 + 0 = 705757185\nLShift + RMB Click: 42 * 16777216 + 1114112 + 1 + 128 = 705757313\nLShift + RMB Double Click: 42 * 16777216 + 1114112 + 1 + 256 = 705757441\n```","syntaxes":[{"syntax":"inputMouse button","since":null,"effect":null,"exec":null,"params":[{"name":"button","type":"Number","optional":false,"default":null,"description":"button number 0..7: 0-LMB, 1-RMB, 2-MMB","types":["Number"],"since":null,"text":"button: Number - button number 0..7: 0-LMB, 1-RMB, 2-MMB"}],"returns":{"type":"Number","types":["Number"],"description":"the state of the button: - 0 - released - 1 - click - 2 - click + hold - 3 - double click - 4 - double click + hold","text":"Number - the state of the button:\n- 0 - released\n- 1 - click\n- 2 - click + hold\n- 3 - double click\n- 4 - double click + hold"},"form":"unary","operator":null,"left":null,"right":{"text":"button","types":["Number"]}},{"syntax":"inputMouse combocode","since":null,"effect":null,"exec":null,"params":[{"name":"combocode","type":"String","optional":false,"default":null,"description":"code or combination (see actionKeys)","types":["String"],"since":null,"text":"combocode: String - code or combination (see actionKeys)"}],"returns":{"type":"Boolean","types":["Boolean"],"description":"true if given code/combination detected, false otherwise","text":"Boolean - true if given code/combination detected, false otherwise"},"form":"unary","operator":null,"left":null,"right":{"text":"combocode","types":["String"]}}],"examples":[{"text":"State of the RMB:\n\n```sqf\nonEachFrame { hintSilent str inputMouse 1 };\n```","code":["onEachFrame { hintSilent str inputMouse 1 };"]},{"text":"Detect LCtrl + 2xRMB:\n\n```sqf\nonEachFrame { hintSilent str inputMouse \"487653633\" };\n```","code":["onEachFrame { hintSilent str inputMouse \"487653633\" };"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["inputController","inputAction","actionKeys","actionKeysImages","actionKeysNames","actionIDs","actionParams","addAction","setUserActionText","inGameUISetEventHandler","showHUD","removeAction","removeAllActions","action"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Interaction","Introduced with Arma 3 version 2.08","Scripting Commands"]}