actionKeysEx: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Update with USEFUL information <:aviator:717748619796545677> - thanks Lou for creating the page :D)
m (Some wiki formatting)
 
(7 intermediate revisions by 2 users not shown)
Line 4: Line 4:
|version1= 2.10
|version1= 2.10


|branch= dev


|descr= Gives a broken down version of the return from [[actionKeys]]. Returns an [[array]] containing the breakdowns of the [[DIK_KeyCodes|dikCodes]] of keys, buttons and combos assigned to the given user action. Action names can be found in config class ControllerSchemes or [[:Category:Key Actions|user action names]] or user profile, for example:
|gr1= Interaction
<syntaxhighlight lang="cpp">
 
keyWatch[] = { 24 };
|descr= Gives a broken down version of [[actionKeys]] return. Returns an [[Array]] containing the breakdowns of the [[DIK_KeyCodes|dikCodes]] of keys, buttons and combos assigned to the given user action.<br>
</syntaxhighlight>
Action names can be found in config class ControllerSchemes or [[:Category:Key Actions|user action names]] or user profile (see {{Link|#Example 1}}).<br>
To retrieve the broken down value, use the property name without 'key':
In addition, some of the actions are also listed here: [[inputAction/actions]]
<code>[[actionKeysEx]] "Watch"; {{cc|[[[24, "KEYBOARD"], [], false]]}}</code>
In addition, some of the actions are also listed in here: [[inputAction/actions]]


The Key Device can be one of several types:
The Key Device can be one of several types:
{{Columns|3|
* {{hl|"KEYBOARD"}}
* {{hl|"KEYBOARD"}}
* {{hl|"MOUSE_BUTTON"}}
* {{hl|"MOUSE_BUTTON"}}
Line 22: Line 20:
* {{hl|"JOYSTICK_POV"}}
* {{hl|"JOYSTICK_POV"}}
* {{hl|"XINPUT"}} - (Xbox) Controller Input
* {{hl|"XINPUT"}} - (Xbox) Controller Input
* {{hl|"TRACKER"}} - Motion Tracking (TrackIR, Tobii, etc.)
* {{hl|"TRACKER"}} - Motion Tracking (TrackIR, Tobii etc)
 
}}
|gr1= Interaction


|s1= [[actionKeysEx]] userAction
|s1= [[actionKeysEx]] userAction
Line 30: Line 27:
|p1= userAction: [[String]] - user action name (see [[inputAction/actions]])
|p1= userAction: [[String]] - user action name (see [[inputAction/actions]])


|r1= [[Array]] of Arrays - using the following format for each action key:
|r1= [[Array]] of [[Array]]s in format [mainKeyArray, comboKeyArray, isDoubleTap]:
{{Feature|warning|The action key array format is subject to change as development for 2.10 is ongoing.}}
* mainKeyArray: [[Array]] in format [dikCode, device, deviceId]:
# Main Key [[Array]] - Always given
** dikCode: [[Number]]
#* Main Key DIK Code: [[Number]]
** device: [[String]]
#* Main Key Device: [[String]]
** deviceId: [[Number]] - only given if the device is a Joystick type
#* Main Key Device ID: [[Number]] - Only given if the device is a Joystick type
* comboKeyArray: [[Array]] identical to ''mainKeyArray'' - filled only if the action key is a key combination
# Combo Key [[Array]] - Only if the action key is a key combination
** dikCode: [[Number]]
#* Combo Key DIK Code: [[Number]]
** device: [[String]]
#* Combo Key Device: [[String]]
** deviceId: [[Number]] - identical to ''mainKeyArray''<nowiki/>'s ''deviceId'' as it is impossible to use two different Joystick devices in a key combination
#* Combo Key Device ID: [[Number]] - Would always be the same as the Main Key Device ID, as it is not possible to use two different Joystick devices in a key combination
* isDoubleTap: [[Boolean]] - is the action key a double-tap. In case of a combination key this applies to the main key.
# IsDoubleTap Flag: [[Boolean]] - Action Key is a double-tap. Only possible when there is just the Main Key, key combinations can't have a double-tap flag
 
|x1= To retrieve the following key's data, use the property name without 'key':
<syntaxhighlight lang="cpp">keyWatch[] = { 24 };</syntaxhighlight>
<sqf>actionKeysEx "Watch"; // [[[24, "KEYBOARD"], [], false]]</sqf>


|x1= <sqf>private _result = actionKeysEx "OpticsMode"; // [[[129,"MOUSE_BUTTON"],[29,"KEYBOARD"],false],[[181,"KEYBOARD"],[],false]]</sqf>
|x2= <sqf>private _result = actionKeysEx "OpticsMode"; // [[[129,"MOUSE_BUTTON"],[29,"KEYBOARD"],false],[[181,"KEYBOARD"],[],false]]</sqf>


|seealso= [[actionKeys]] [[actionKeysNames]] [[actionKeysNamesArray]]
|seealso= [[actionKeys]] [[actionKeysNames]] [[actionKeysNamesArray]]
}}
}}

Latest revision as of 16:42, 17 April 2023

Hover & click on the images for description

Description

Description:
Gives a broken down version of actionKeys return. Returns an Array containing the breakdowns of the dikCodes of keys, buttons and combos assigned to the given user action.
Action names can be found in config class ControllerSchemes or user action names or user profile (see Example 1).
In addition, some of the actions are also listed here: inputAction/actions The Key Device can be one of several types:
  • "KEYBOARD"
  • "MOUSE_BUTTON"
  • "MOUSE_AXIS"
  • "JOYSTICK_BUTTON"
  • "JOYSTICK_AXIS"
  • "JOYSTICK_POV"
  • "XINPUT" - (Xbox) Controller Input
  • "TRACKER" - Motion Tracking (TrackIR, Tobii etc)
Groups:
Interaction

Syntax

Syntax:
actionKeysEx userAction
Parameters:
userAction: String - user action name (see inputAction/actions)
Return Value:
Array of Arrays in format [mainKeyArray, comboKeyArray, isDoubleTap]:
  • mainKeyArray: Array in format [dikCode, device, deviceId]:
    • dikCode: Number
    • device: String
    • deviceId: Number - only given if the device is a Joystick type
  • comboKeyArray: Array identical to mainKeyArray - filled only if the action key is a key combination
    • dikCode: Number
    • device: String
    • deviceId: Number - identical to mainKeyArray's deviceId as it is impossible to use two different Joystick devices in a key combination
  • isDoubleTap: Boolean - is the action key a double-tap. In case of a combination key this applies to the main key.

Examples

Example 1:
To retrieve the following key's data, use the property name without 'key':
keyWatch[] = { 24 };
actionKeysEx "Watch"; // [[[24, "KEYBOARD"], [], false]]
Example 2:
private _result = actionKeysEx "OpticsMode"; // [[[129,"MOUSE_BUTTON"],[29,"KEYBOARD"],false],[[181,"KEYBOARD"],[],false]]

Additional Information

See also:
actionKeys actionKeysNames actionKeysNamesArray

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