Description
Function that executes code when a key has been held down for a long enough time - "Hold X to Advance" text is displayed when any key is pressed.
All other keys (but Esc) are deactivated until the conditions are met - only mouse controls work (character rotation and fire).
Syntax
[display, key, time, code, control] call BIS_fnc_holdKey
Parameters:
display: Display - (Optional, defaultfindDisplay 12for map display) display the event is attached to. By default it is the map displaykey: Number - (Optional, default 57 for Space) what key to press - see DIK KeyCodestime: Number - (Optional, default 3) how long the key has to be held down in secondscode: Code - (Optional, default{}) scheduled code to be executed when key is held down for long enoughcontrol: Control - (Optional, default controlNull) text control to be used in place of the default "Press X to skip" control.
Returns: Nothing
Examples
Example 1
[findDisplay 46, 36, 5, { hint "Key 'J' pressed for 5 seconds" }] spawn BIS_fnc_holdKey; // action is added to the mission display