inputAction: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " \| arma2 \| *([0-9]\.[0-9]{2}) * " to " | arma2 |$1 |game2= arma2oa |version2= 1.50 |game3= tkoh |version3= 1.00 |game4= arma3 |version4= 0.50 ") |
Lou Montana (talk | contribs) m (Text replacement - "<sqf>([^↵][^\/]*↵[^\/]*)<\/sqf>" to "<sqf> $1 </sqf>") |
||
(39 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
| arma2 | |game1= arma2 | ||
|1.00 | |version1= 1.00 | ||
|game2= arma2oa | |game2= arma2oa | ||
Line 15: | Line 15: | ||
|gr1= Interaction | |gr1= Interaction | ||
| Return the state of input devices mapped to given input action. | |descr= Return the state of input devices mapped to given input action. | ||
<br> | <br> | ||
For Arma 3 inputActions and its bindings see: [[{{PAGENAME}}/actions]]. | For Arma 3 inputActions and its bindings see: [[{{PAGENAME}}/actions]]. | ||
Line 21: | Line 21: | ||
For earlier Arma editions see [[:Category:Key Actions]]. | For earlier Arma editions see [[:Category:Key Actions]]. | ||
| | |s1= [[inputAction]] name | ||
|p1= name: [[String]] - name of the action | |p1= name: [[String]] - name of the action | ||
| [[Number]] | |r1= [[Number]] | ||
|x1= < | |x1= <sqf>inputAction "leanLeft";</sqf> Returns 1 if the button mapped to "leanLeft" is pressed currently else 0. | ||
|x2= < | |x2= <sqf> | ||
0 spawn { | |||
waitUntil {inputAction "reloadMagazine" > 0}; | |||
};</ | hint "Reload Key Pressed"; | ||
}; | |||
</sqf> | |||
|seealso= [[actionKeys]] | |seealso= [[inputMouse]] [[inputController]] [[actionKeys]] [[actionKeysImages]] [[actionKeysNames]] [[actionIDs]] [[actionParams]] [[addAction]] [[setUserActionText]] [[inGameUISetEventHandler]] [[showHUD]] [[removeAction]] [[removeAllActions]] [[action]] | ||
}} | }} | ||
<dl class="command_description"> | <dl class="command_description"> | ||
<dt></dt> | <dt></dt> | ||
<dd class="notedate">Posted on 07:38, 15 October 2010 (CEST)</dd> | <dd class="notedate">Posted on 07:38, 15 October 2010 (CEST)</dd> | ||
Line 43: | Line 46: | ||
<dd class="note"> | <dd class="note"> | ||
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). | 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). | ||
<dt></dt> | <dt></dt> | ||
<dd class="notedate">Posted on | <dd class="notedate">Posted on 2014-05-08 - 15:18 (UTC)</dd> | ||
<dt class="note">[[User:FlannelMouth|FlannelMouth]]</dt> | <dt class="note">[[User:FlannelMouth|FlannelMouth]]</dt> | ||
<dd class="note"> | <dd class="note"> | ||
[[inputAction]] does not return the actual state of the queried key when a dialog screen is open. Instead, it will always return 0. | [[inputAction]] does not return the actual state of the queried key when a dialog screen is open. Instead, it will always return 0. | ||
</dd> | </dd> | ||
<dt><dt> | <dt><dt> | ||
<dd class="notedate">Posted on | <dd class="notedate">Posted on 2015-07-31 - 05:33 (UTC)</dd> | ||
<dt class="note">[[User:Waffle SS.|Waffle SS.]]</dt> | <dt class="note">[[User:Waffle SS.|Waffle SS.]]</dt> | ||
<dd class="note"> | <dd class="note"> | ||
Line 65: | Line 62: | ||
Right mouse click is currently not supported, but right mouse hold is: https://feedback.bistudio.com/T83382 | Right mouse click is currently not supported, but right mouse hold is: https://feedback.bistudio.com/T83382 | ||
</dd> | </dd> | ||
</dl> | </dl> |
Latest revision as of 11:34, 3 September 2024
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
- Syntax:
- inputAction name
- Parameters:
- name: String - name of the action
- Return Value:
- Number
Examples
- Example 1:
- Returns 1 if the button mapped to "leanLeft" is pressed currently else 0.inputAction "leanLeft";
- Example 2:
Additional Information
- See also:
- inputMouse inputController actionKeys actionKeysImages actionKeysNames actionIDs actionParams addAction setUserActionText inGameUISetEventHandler showHUD removeAction removeAllActions action
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
- 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).
- Posted on 2014-05-08 - 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 2015-07-31 - 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