{"name":"inputAction","title":"inputAction","type":"command","url":"https://community.bistudio.com/wiki/inputAction","revid":379355,"updated":"2026-10-30T23:55:30Z","groups":["Interaction"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","description":"Return the state of input devices mapped to given input action.\n\nFor Arma 3 inputActions and its bindings see: inputAction/actions.\n\nFor earlier Arma editions see Category:Key Actions.","syntaxes":[{"syntax":"inputAction name","params":[{"name":"name","type":"String","description":"name of the action","type_expr":"String"}],"returns":{"type":"Number","type_expr":"Number"},"form":"unary","right":{"text":"name"}}],"examples":[{"text":"```sqf\ninputAction \"leanLeft\";\n```\n\nReturns 1 if the button mapped to \"leanLeft\" is pressed currently else 0.","code":["inputAction \"leanLeft\";"]},{"text":"```sqf\n0 spawn {\n    waitUntil {inputAction \"reloadMagazine\" > 0};\n    hint \"Reload Key Pressed\";\n};\n```","code":["0 spawn {\n\twaitUntil {inputAction \"reloadMagazine\" > 0};\n\thint \"Reload Key Pressed\";\n};"]}],"see_also":["inputMouse","inputController","actionKeys","actionKeysImages","actionKeysNames","actionIDs","actionParams","addAction","setUserActionText","inGameUISetEventHandler","showHUD","removeAction","removeAllActions","action"],"notes":[{"user":"Worldeater","date":"2010-10-15T05:38:00Z","text":"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 does not work reliably when used in RscDisplayMission's onKeyDown event handler (the same is probably true for other input related event handlers)."},{"user":"FlannelMouth","date":"2014-05-08T15:18:00Z","text":"inputAction does not return the actual state of the queried key when a dialog screen is open. Instead, it will always return 0."},{"user":"Waffle SS.","date":"2015-07-31T05:33:00Z","text":"**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.\n\nRight mouse click is currently not supported, but right mouse hold is: https://feedback.bistudio.com/T83382"}]}