actionKeysEx: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Page creation - thanks NeilZar for the info :D)
 
(Update with USEFUL information <:aviator:717748619796545677> - thanks Lou for creating the page :D)
Line 6: Line 6:
|branch= dev
|branch= dev


|descr= Returns something way too complicated to explain at the end of a working day, also subject to change.
|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:
<syntaxhighlight lang="cpp">
keyWatch[] = { 24 };
</syntaxhighlight>
To retrieve the broken down value, use the property name without 'key':
<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:
* {{hl|"KEYBOARD"}}
* {{hl|"MOUSE_BUTTON"}}
* {{hl|"MOUSE_AXIS"}}
* {{hl|"JOYSTICK_BUTTON"}}
* {{hl|"JOYSTICK_AXIS"}}
* {{hl|"JOYSTICK_POV"}}
* {{hl|"XINPUT"}} - (Xbox) Controller Input
* {{hl|"TRACKER"}} - Motion Tracking (TrackIR, Tobii, etc.)


|gr1= Interaction
|gr1= Interaction
Line 14: Line 30:
|p1= userAction: [[String]] - user action name (see [[inputAction/actions]])
|p1= userAction: [[String]] - user action name (see [[inputAction/actions]])


|r1= [[Array]]
|r1= [[Array]] of Arrays - using the following format for each action key:
{{Feature|warning|The action key array format is subject to change as development for 2.10 is ongoing.}}
# Main Key [[Array]] - Always given
#* Main Key DIK Code: [[Number]]
#* Main Key Device: [[String]]
#* Main Key Device ID: [[Number]] - Only given if the device is a Joystick type
# Combo Key [[Array]] - Only if the action key is a key combination
#* Combo Key DIK Code: [[Number]]
#* Combo Key Device: [[String]]
#* 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 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= <sqf>private _result = actionKeysEx "";</sqf>
|x1= <sqf>private _result = actionKeysEx "OpticsMode"; // [[[129,"MOUSE_BUTTON"],[29,"KEYBOARD"],false],[[181,"KEYBOARD"],[],false]]</sqf>


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

Revision as of 14:09, 29 March 2022

Hover & click on the images for description
Only available in Development branch(es) until its release with Arma 3 patch v2.10.

Description

Description:
Gives a broken down version of the return from actionKeys. 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, for example:
keyWatch[] = { 24 };

To retrieve the broken down value, use the property name without 'key': actionKeysEx "Watch"; // [[[24, "KEYBOARD"], [], false]] In addition, some of the actions are also listed in 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 - using the following format for each action key:
The action key array format is subject to change as development for 2.10 is ongoing.
  1. Main Key Array - Always given
    • Main Key DIK Code: Number
    • Main Key Device: String
    • Main Key Device ID: Number - Only given if the device is a Joystick type
  2. Combo Key Array - Only if the action key is a key combination
    • Combo Key DIK Code: Number
    • Combo Key Device: String
    • 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
  3. 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

Examples

Example 1:
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