BIS fnc holdKey: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\| *((\[\[[a-zA-Z0-9_ :\\\-\/|()]+\]\],? ?)+) * \}\}" to "|seealso= $1 }}")
(formatting)
Line 1: Line 1:
{{RV|type=function
{{RV|type=function


| arma3
|game1= arma3


|1.78
|version1= 1.78


|gr1 = Interaction
|gr1 = Interaction


|Function that executes a user-defined code when a key has been held down for a long enough time.
|descr= Function that executes a user-defined code when a key has been held down for a long enough time.


|[display, key, time, code, control] call '''BIS_fnc_holdKey'''
|s1= [display, key, time, code, control] call '''BIS_fnc_holdKey'''


|p1= [[Display]] - display  - Display the event is attached to (map display is default).
|p1= display: [[Display]] - Display the event is attached to. By default it is the map display
|p2= [[Number]] - key  - What key to press.
|p3= [[Number]] - time  - how long the key has to be held down in seconds.
|p4= [[Code]] - code  - Code to be executed when key is held down for long enough.
|p5= [[Control]] - control - Optional - text control to be used in place of the default "Press X to skip" control.


| None
|p2= key: [[Number]] - What key to press. See [[DIK KeyCodes]]
 
|p3= time: [[Number]] -  How long the key has to be held down in seconds
 
|p4= code: [[Code]] - Code to be executed when key is held down for long enough. [[canSuspend]] returns [[true]] inside the code
 
|p5= control: [[Control]] - (optional, default [[controlNull]] - Text control to be used in place of the default "Press X to skip" control.
 
|r1= [[Nothing]]


|x1= <code><nowiki>[</nowiki>[[findDisplay]] 46,36,5, {[[hint]] "Key 'J' pressed for 5 seconds"}] [[call]] [[BIS_fnc_holdKey]]; // Action is added to the mission display</code>
|x1= <code><nowiki>[</nowiki>[[findDisplay]] 46,36,5, {[[hint]] "Key 'J' pressed for 5 seconds"}] [[call]] [[BIS_fnc_holdKey]]; // Action is added to the mission display</code>
Line 23: Line 27:
|seealso= [[BIS_fnc_holdActionAdd]], [[addAction]]
|seealso= [[BIS_fnc_holdActionAdd]], [[addAction]]
}}
}}
<dl class="command_description">
<!-- Note Section BEGIN -->
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 12:56, 26 March 2021

Hover & click on the images for description

Description

Description:
Function that executes a user-defined code when a key has been held down for a long enough time.
Execution:
call
Groups:
Interaction

Syntax

Syntax:
[display, key, time, code, control] call BIS_fnc_holdKey
Parameters:
display: Display - Display the event is attached to. By default it is the map display
key: Number - What key to press. See DIK KeyCodes
time: Number - How long the key has to be held down in seconds
code: Code - Code to be executed when key is held down for long enough. canSuspend returns true inside the code
control: Control - (optional, default controlNull - Text control to be used in place of the default "Press X to skip" control.
Return Value:
Nothing

Examples

Example 1:
[findDisplay 46,36,5, {hint "Key 'J' pressed for 5 seconds"}] call BIS_fnc_holdKey; // Action is added to the mission display

Additional Information

See also:
BIS_fnc_holdActionAddaddAction

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