inputAction: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...) |
||
Line 1: | Line 1: | ||
{{Command | {{Command | ||
| arma2 | | arma2 | ||
|1.00 | |1.00 | ||
|gr1= Interaction | |gr1= Interaction | ||
| Return the state of input devices mapped to given input action. | | Return the state of input devices mapped to given input action. | ||
Line 11: | Line 11: | ||
For Arma 3 inputActions and its bindings see: [[{{PAGENAME}}/actions]]. | For Arma 3 inputActions and its bindings see: [[{{PAGENAME}}/actions]]. | ||
<br> | <br> | ||
For earlier Arma editions see [[:Category:Key Actions]]. | For earlier Arma editions see [[:Category:Key Actions]]. | ||
| '''inputAction''' name | | '''inputAction''' name | ||
|p1= name: [[String]] - name of the action | |p1= name: [[String]] - name of the action | ||
| [[Number]] | | [[Number]] | ||
|x1= <code>[[inputAction]] "leanLeft"</code> Returns 1 if the button mapped to "leanLeft" is pressed currently else 0. | |x1= <code>[[inputAction]] "leanLeft"</code> Returns 1 if the button mapped to "leanLeft" is pressed currently else 0. | ||
|x2= <code>[] [[spawn]] { | |x2= <code>[] [[spawn]] { | ||
[[waitUntil]] {[[inputAction]] "reloadMagazine" > 0}; | [[waitUntil]] {[[inputAction]] "reloadMagazine" > 0}; | ||
[[hint]] "Reload Key Pressed"; | [[hint]] "Reload Key Pressed"; | ||
};</code> | };</code> | ||
| [[actionKeys]], [[actionKeysImages]], [[actionKeysNames]], [[actionIDs]], [[actionParams]], [[addAction]], [[setUserActionText]], [[inGameUISetEventHandler]], [[showHUD]], [[removeAction]], [[removeAllActions]], [[action]] | | [[actionKeys]], [[actionKeysImages]], [[actionKeysNames]], [[actionIDs]], [[actionParams]], [[addAction]], [[setUserActionText]], [[inGameUISetEventHandler]], [[showHUD]], [[removeAction]], [[removeAllActions]], [[action]] | ||
| |MPBEHAVIOUR= | | |MPBEHAVIOUR= |
Revision as of 00:41, 18 January 2021
Description
- Description:
- Return the state of input devices mapped to given input action.
For Arma 3 inputActions and its bindings see: inputAction/actions.
For earlier Arma editions see Category:Key Actions. - Groups:
- Interaction
Syntax
Examples
- Example 1:
inputAction "leanLeft"
Returns 1 if the button mapped to "leanLeft" is pressed currently else 0.- Example 2:
[] spawn { waitUntil {inputAction "reloadMagazine" > 0}; hint "Reload Key Pressed"; };
Additional Information
- See also:
- actionKeysactionKeysImagesactionKeysNamesactionIDsactionParamsaddActionsetUserActionTextinGameUISetEventHandlershowHUDremoveActionremoveAllActionsaction
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Notes
- Posted on 07:38, 15 October 2010 (CEST)
- Worldeater
- 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).
Bottom Section
- Posted on May 8, 2014 - 15:18 (UTC)
- FlannelMouth
- inputAction does not return the actual state of the queried key when a dialog screen is open. Instead, it will always return 0.
- Posted on July 31, 2015 - 05:33 (UTC)
- Waffle SS.
-
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.
Right mouse click is currently not supported, but right mouse hold is: https://feedback.bistudio.com/T83382