actionKeysNames: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(see also)
m (Text replacement - "\] +\[" to "] [")
 
(75 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma |= Game name
|game1= ofpe
|version1= 1.00


|1.00|= Game version
|game2= arma1
____________________________________________________________________________________________
|version2= 1.00


| Returns a list of button names assigned to the given user action. A maximum of maxKeys keys is listed. You can find the action names in config class ControllerSchemes or [[ArmA: CfgDefaultKeysMapping|user action names]]. |= Description
|game3= arma2
____________________________________________________________________________________________
|version3= 1.00


| [[String]] <nowiki>=</nowiki> '''actionKeysNames''' userAction |= Syntax
|game4= arma2oa
|version4= 1.50


|p1= userAction: [[String]] |= Parameter 1
|game5= tkoh
|version5= 1.00


| [[String]] |= Return value
|game6= arma3
____________________________________________________________________________________________
|version6= 0.50


|s2= [[String]] <nowiki>=</nowiki> '''actionKeysNames''' [userAction, maxKeys] |= Syntax 2
|gr1= Interaction


|p21= [userAction, maxKeys]: [[Array]] |= Parameter 1
|descr= Returns a list of button names assigned to the given user action.
Action names can be found in config class {{hl|ControllerSchemes}} or [[:Category:Key Actions|user action names]].


|p22= UserAction: [[String]] |= Parameter 2
|s1= [[actionKeysNames]] userAction


|p23= maxKeys: [[Number]] |= Parmameter 3
|p1= userAction: [[String]]


|r2= [[String]] |= Return value
|r1= [[String]]
____________________________________________________________________________________________
 
|x1= <pre>_list = actionKeysNames "ReloadMagazine"</pre> |= Example 1
____________________________________________________________________________________________


| [[actionKeys]], [[actionKeysImages]], [[actionKeysNamesArray]] |= See also
|s2= [[actionKeysNames]] [userAction, maxKeys, inputDevicePriority]


}}
|p21= userAction: [[String]]
 
|p22= maxKeys: [[Number]] - maximum number of keys to return
 
|p23= inputDevicePriority: [[String]] - result sorted by inputDevicePriority with values:
* {{hl|"Mouse"}}
* {{hl|"Keyboard"}}
* {{hl|"Stick"}}
* {{hl|"Gamepad"}}
* {{hl|"Tracker"}}
* {{hl|"Combo"}} (mouse and keyboard combinations)
* {{sic|{{hl|"Controler"}}}} (any controller other than mouse or keyboard)
Other values are considered as:
* {{hl|"Unsorted"}}
|p23since= arma3 1.36
 
|r2= [[String]]


<h3 style="display:none">Notes</h3>
|x1= <sqf>_list = actionKeysNames "ReloadMagazine"; // """R"" or ""XBox X"""</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on 06:08, 3 June 2008 (CEST)</dd>
<dt class="note">'''[[User:General Barron|General Barron]]'''</dt>
<dd class="note">You can find a list of all available actions [[key_actions_(VBS2)|here]]. The list is for VBS2, so there are a few actions that are not available in Arma.</dd>
<dd class="notedate">Posted on 20:14, 20 January 2010 (CET) </dd>
<dt class="note">'''[[User:WGL.Q|kju]]'''</dt>
<dd class="note">The return type is a stacked string. A string inside a string. To compare use first single and inside double quotes:<br>
if ((actionKeysNames "User1") == '"W"') then ...</dd>
<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[actionKeys]] [[actionKeysImages]] [[actionKeysNamesArray]] [[actionName]] [[inputAction]]
}}


[[Category:Scripting Commands|ACTIONKEYSNAMES]]
{{Note
[[Category:Scripting Commands OFP Elite |ACTIONKEYSNAMES]]
|user= WGL.Q
[[Category:Scripting Commands ArmA|ACTIONKEYSNAMES]]
|timestamp= 20100120201400
[[Category:Command_Group:_Interaction|{{uc:{{PAGENAME}}}}]]
|text= The return type is a stacked string. A string inside a string. To compare use first single and inside double quotes:<br>
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
<sqf>if (actionKeysNames "User1" == '"W"') then { /* ... */ };</sqf>
}}

Latest revision as of 11:46, 5 May 2024

Hover & click on the images for description

Description

Description:
Returns a list of button names assigned to the given user action. Action names can be found in config class ControllerSchemes or user action names.
Groups:
Interaction

Syntax

Syntax:
actionKeysNames userAction
Parameters:
userAction: String
Return Value:
String

Alternative Syntax

Syntax:
actionKeysNames [userAction, maxKeys, inputDevicePriority]
Parameters:
userAction: String
maxKeys: Number - maximum number of keys to return
since Arma 3 logo black.png1.36
inputDevicePriority: String - result sorted by inputDevicePriority with values:
  • "Mouse"
  • "Keyboard"
  • "Stick"
  • "Gamepad"
  • "Tracker"
  • "Combo" (mouse and keyboard combinations)
  • "Controler"sic (any controller other than mouse or keyboard)
Other values are considered as:
  • "Unsorted"
Return Value:
String

Examples

Example 1:
_list = actionKeysNames "ReloadMagazine"; // """R"" or ""XBox X"""

Additional Information

See also:
actionKeys actionKeysImages actionKeysNamesArray actionName inputAction

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
WGL.Q - c
Posted on Jan 20, 2010 - 20:14 (UTC)
The return type is a stacked string. A string inside a string. To compare use first single and inside double quotes:
if (actionKeysNames "User1" == '"W"') then { /* ... */ };