inputAction: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(A3 actions added)
m (Text replacement - "<sqf>([^↵][^\/]*↵[^\/]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(94 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma2 |= Game name
|game1= arma2
|version1= 1.00


|1.00|= Game version
|game2= arma2oa
____________________________________________________________________________________________
|version2= 1.50


| Return the state of input devices mapped to given input action (see [[:Category:Key Actions]] for action names).  |= Description
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| '''inputAction''' name |= Syntax
|game4= arma3
|version4= 0.50


|p1= name: [[String]] - name of the action |= PARAMETER1
|gr1= Interaction


| [[Number]] |= RETURNVALUE
|descr= Return the state of input devices mapped to given input action.
<br>
For Arma 3 inputActions and its bindings see: [[{{PAGENAME}}/actions]].
<br>
For earlier Arma editions  see [[:Category:Key Actions]].


|s1= [[inputAction]] name


|x1= <code>[[inputAction]] "leanLeft"</code> Returns 1 if the button mapped to "leanLeft" is pressed currently else 0. |= EXAMPLE1
|p1= name: [[String]] - name of the action


|x2= <code>[] [[spawn]] {
|r1= [[Number]]
[[waitUntil]] {[[inputAction]] "reloadMagazine" > 0}; 
[[hint]] "Reload Key Pressed";
};</code>|= EXAMPLE2


____________________________________________________________________________________________
|x1= <sqf>inputAction "leanLeft";</sqf> Returns 1 if the button mapped to "leanLeft" is pressed currently else 0.


| [[actionKeys]], [[actionKeysImages]], [[actionKeysNames]] |= SEEALSO
|x2= <sqf>
0 spawn {
waitUntil {inputAction "reloadMagazine" > 0};
hint "Reload Key Pressed";
};
</sqf>


| |= MPBEHAVIOUR
|seealso= [[inputMouse]] [[inputController]] [[actionKeys]] [[actionKeysImages]] [[actionKeysNames]] [[actionIDs]] [[actionParams]] [[addAction]] [[setUserActionText]] [[inGameUISetEventHandler]] [[showHUD]] [[removeAction]] [[removeAllActions]] [[action]]
____________________________________________________________________________________________
}}
}}


<h3 style='display:none'>Notes</h3>
<dl class="command_description">
<dl class='command_description'>
<!-- Note Section BEGIN -->


<dt></dt>
<dd class="notedate">Posted on 07:38, 15 October 2010 (CEST)</dd>
<dt class="note">[[User:Worldeater|Worldeater]]</dt>
<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).
--[[User:Worldeater|Worldeater]] 07:38, 15 October 2010 (CEST)


'''Some of the Arma 3 inputActions (extracted from arma3.exe):'''
<dt></dt>
<dd class="notedate">Posted on 2014-05-08 - 15:18 (UTC)</dd>
<dt class="note">[[User:FlannelMouth|FlannelMouth]]</dt>
<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.  
</dd>


''Adjust, MoveForward, MoveBack, TurnLeft, TurnRight, MoveUp, MoveDown, MoveFastForward, MoveSlowForward, MoveLeft, MoveRight, Prone, LeanLeft, LeanRight, LeanLeftToggle, LeanRightToggle, WalkRunToggle, WalkRunTemp, TactToggle, TactTemp, TactShort, NextWeapon, PrevWeapon, DefaultAction, CycleThrownItems, LockTargets, LockEmptyTargets, LockTarget, RevealTarget, ZoomTemp, TempRaiseWeapon, ToggleRaiseWeapon, PrevAction, NextAction, Action, ActionContext, ActionFreeLook, Headlights, NightVision, CompassToggle, WatchToggle, MiniMap, MiniMapToggle, ShowMap, HideMap, Help, TimeInc, TimeDec, Optics, OpticsTemp, OpticsMode, PersonView, TacticalView, LiteUnitInfoToggle, ZoomIn, ZoomInToggle, ZoomOut, ZoomOutToggle, ZoomContIn, ZoomContOut, ZeroingUp, ZeroingDown, GunElevUp, GunElevDown, GunElevSlow, GunElevAuto, LookAround, LookAroundToggle, LookLeftDown, LookDown, LookRightDown, LookLeft, LookCenter, LookRight, LookLeftUp, LookUp, LookRightUp, LookLeftCont, LookRightCont, LookDownCont, LookUpCont, LookShiftLeftCont, LookShiftRightCont, LookShiftUpCont, LookShiftDownCont, LookShiftForwardCont, LookShiftBackCont, LookRollLeftCont, LookRollRightCont, LookShiftLeft, LookShiftRight, LookShiftUp, LookShiftDown, LookShiftForward, LookShiftBack, LookRollLeft, LookRollRight, LookShiftCenter, FreeHeadMove, PrevChannel, NextChannel, VoiceOverNet, PushToTalk, PushToTalkAll, PushToTalkSide, PushToTalkCommand, PushToTalkGroup, PushToTalkVehicle, PushToTalkDirect, NetworkStats, NetworkPlayers, SelectAll, Turbo, TurboToggle, VehicleTurbo, Walk, HoldBreath, AimUp, AimDown, AimLeft, AimRight, AimHeadUp, AimHeadDown, AimHeadLeft, AimHeadRight, IngamePause, MenuSelect, MenuBack, ForceCommandingMode, SwitchCommand, HeliUp, HeliDown, HeliLeft, HeliRight, AirBankLeft, AirBankRight, HeliRudderLeft, HeliRudderRight, HeliForward, HeliBack, HeliFastForward, HeliThrottlePos, HeliThrottleNeg, HeliBrakes, HeliCyclicForward, HeliCyclicBack, HeliCyclicLeft, HeliCyclicRight, HeliCollectiveRaise, HeliCollectiveLower, HeliCollectiveRaiseCont, HeliCollectiveLowerCont, HeliBatteriesToggle, HeliRotorBrakeToggle, HeliEnginesToggle, HeliWheelsBrake, HeliTrimLeft, HeliTrimRight, HeliTrimForward, HeliTrimBackward, HeliTrimRudderLeft, HeliTrimRudderRight, HeliRopeAction, SubmarineUp, SubmarineDown, SubmarineLeft, SubmarineRight, SubmarineForward, SubmarineBack, SubmarineCyclicForward, SubmarineCyclicBack, SeagullUp, SeagullDown, SeagullForward, SeagullBack, SeagullFastForward, CarLeft, CarRight, CarWheelLeft, CarWheelRight, CarForward, CarBack, CarFastForward, CarSlowForward, CarSoftBrake, CarBrake, CarHandBrake, CarAccelerate, CarGearUp, CarGearDwn, CarShiftFwd1, CarShiftFwd2, CarShiftFwd3, CarShiftFwd4, CarShiftFwd5, CarShiftFwd6, CarShiftFwd7, CarShiftFwd8, CarShiftRvs1, CarShiftRvs2, CarAimUp, CarAimDown, CarAimLeft, CarAimRight, CommandLeft, CommandRight, CommandForward, CommandBack, CommandFast, CommandSlow, SwitchGunnerWeapon, VehLockTargets, VehLockEmptyTargets, SwapGunner, HeliManualFire, CommandWatch, TeamSwitchPrev, TeamSwitchNext, LaunchCM, NextCM, HelicopterTrimOn, HelicopterTrimOff, CopyVersion, BuldSwitchCamera, BuldFreeLook, BuldSelect, BuldResetCamera, BuldMagnetizePoints, BuldMagnetizePlanes, BuldMagnetizeYFixed, BuldTerrainRaise1m, BuldTerrainRaise10cm, BuldTerrainLower1m, BuldTerrainLower10cm, BuldTerrainRaise5m, BuldTerrainRaise50cm, BuldTerrainLower5m, BuldTerrainLower50cm, BuldTerrainShowNode, BuldSelectionType, BuldLeft, BuldRight, BuldForward, BuldBack, BuldMoveLeft, BuldMoveRight, BuldMoveForward, BuldMoveBack, BuldTurbo, BuldUp, BuldDown, BuldLookLeft, BuldLookRight, BuldLookUp, BuldLookDown, BuldZoomIn, BuldZoomOut, BuldTextureInfo, BuldBrushRatio, BuldBrushStrength, BuldBrushSmooth, BuldBrushRandomize, BuldBrushOuter, BuldUndo, BuldRedo, BuldCreateObj, BuldDuplicateSel, BuldRemoveSel, BuldRotateSelX, BuldRotateSelZ, BuldScaleSel, BuldElevateSel, User1, User2, User3, User4, User5, User6, User7, User8, User9, User10, User11, Raise, HeliCollectiveLower, HeliCollectiveRaiseCont, HeliCollectiveLowerCont, HeliBatteriesToggle, HeliRotorBrakeToggle, HeliEnginesToggle, HeliWheelsBrake, HeliTrimLeft, HeliTrimRight, HeliTrimForward, HeliTrimBackward, HeliTrimRudderLeft, HeliTrimRudderRight, HeliRopeAction, SubmarineUp, SubmarineDown, SubmarineLeft, SubmarineRight, SubmarineForward, SubmarineBack, SubmarineCyclicForward, SubmarineCyclicBack, SeagullUp, SeagullDown, SeagullForward, SeagullBack, SeagullFastForward, CarLeft, CarRight, CarWheelLeft, CarWheelRight, CarForward, CarBack, CarFastForward, CarSlowForward, CarSoftBrake, CarBrake, CarHandBrake, CarAccelerate, CarGearUp, CarGearDwn, CarShiftFwd1, CarShiftFwd2, CarShiftFwd3, CarShiftFwd4, CarShiftFwd5, CarShiftFwd6, CarShiftFwd7, CarShiftFwd8, CarShiftRvs1, CarShiftRvs2, CarAimUp, CarAimDown, CarAimLeft, CarAimRight, CommandLeft, CommandRight, CommandForward, CommandBack, CommandFast, CommandSlow, SwitchGunnerWeapon, VehLockTargets, VehLockEmptyTargets, SwapGunner, HeliManualFire, CommandWatch, TeamSwitchPrev, TeamSwitchNext, LaunchCM, NextCM, HelicopterTrimOn, HelicopterTrimOff, CopyVersion, BuldSwitchCamera, BuldFreeLook, BuldSelect, BuldResetCamera, BuldMagnetizePoints, BuldMagnetizePlanes, BuldMagnetizeYFixed, BuldTerrainRaise1m, BuldTerrainRaise10cm, BuldTerrainLower1m, BuldTerrainLower10cm, BuldTerrainRaise5m, BuldTerrainRaise50cm, BuldTerrainLower5m, BuldTerrainLower50cm, BuldTerrainShowNode, BuldSelectionType, BuldLeft, BuldRight, BuldForward, BuldBack, BuldMoveLeft, BuldMoveRight, BuldMoveForward, BuldMoveBack, BuldTurbo, BuldUp, BuldDown, BuldLookLeft, BuldLookRight, BuldLookUp, BuldLookDown, BuldZoomIn, BuldZoomOut, BuldTextureInfo, BuldBrushRatio, BuldBrushStrength, BuldBrushSmooth, BuldBrushRandomize, BuldBrushOuter, BuldUndo, BuldRedo, BuldCreateObj, BuldDuplicateSel, BuldRemoveSel, BuldRotateSelX, BuldRotateSelZ, BuldScaleSel, BuldElevateSel, User1, User2, User3, User4, User5, User6, User7, User8, User9, User10, User11, User12, User13, User14, User15, User16, User17, User18, User19, User20User12, User13, User14, User15, User16, User17, User18, User19, User20'' --[[User:Killzone_Kid|Killzone_Kid]] 20 October 2013
<dt><dt>
<dd class="notedate">Posted on 2015-07-31 - 05:33 (UTC)</dd>
<dt class="note">[[User:Waffle SS.|Waffle SS.]]</dt>
<dd class="note">
'''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.
<br><br>
Right mouse click is currently not supported, but right mouse hold is: https://feedback.bistudio.com/T83382
</dd>


<!-- Note Section END -->
</dl>
</dl>
<h3 style='display:none'>Bottom Section</h3>
[[Category:ArmA 2: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 11:34, 3 September 2024

Hover & click on the images for description

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:
inputAction "leanLeft";
Returns 1 if the button mapped to "leanLeft" is pressed currently else 0.
Example 2:
0 spawn { waitUntil {inputAction "reloadMagazine" > 0}; hint "Reload Key Pressed"; };

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