disableUserInput

From Bohemia Interactive Community
Hover & click on the images for description

Description

Description:
Disables or enables the keyboard and mouse input. Usually used during cutscenes.
Be careful and responsible with the usage of this command. Once the user input is disabled, the only option left is to restart the game. Make sure you provide scripted mechanics to resolve this, should you need to disable user input for any reason.
Groups:
Interaction

Syntax

Syntax:
disableUserInput state
Parameters:
state: Boolean - true to disable, false to enable
Return Value:
Nothing

Examples

Example 1:
Copy
disableUserInput true; // cutscene disableUserInput false;
Example 2:
Reset user input if a key was pressed:
Copy
disableUserInput true; // here e.g W was pressed sleep 2; // the user releases keys disableUserInput false; // the game considers W is still pressed as it did not listen to a "KeyUp" event disableUserInput true; disableUserInput false; // this resets released keys making the issue invisible // this workaround does not fix the mouse input that may get stuck on disableUserInput call

Additional Information

See also:
userInputDisabled enableSimulation enableSimulationGlobal

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