disableUserInput: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " \| *ofp * *\| *1.([0-9]{2}) * +\|([^g]|g[^a])" to " | ofp |1.$1 |game2= ofpe |version2= 1.00 |game3= arma1 |version3= 1.00 |game4= arma2 |version4= 1.00 |game5= arma2oa |version5= 1.50 |game6= tkoh |version6= 1.00 |game7= arm...)
m (Text replacement - " \| *(([^=\| ]+)('''|\[\[)([^=\| ]+)) * \|p1=" to " |s1= $1 |p1=")
Line 28: Line 28:
| Disables or enables the keyboard and mouse input. Usually used during cutscenes.{{Feature | Warning | 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.}}
| Disables or enables the keyboard and mouse input. Usually used during cutscenes.{{Feature | Warning | 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.}}


| '''disableUserInput''' state
|s1=  '''disableUserInput''' state


|p1= state: [[Boolean]] - [[true]] to disable, [[false]] to enable
|p1= state: [[Boolean]] - [[true]] to disable, [[false]] to enable

Revision as of 22:59, 12 June 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Interaction

Syntax

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

Examples

Example 1:
disableUserInput true; // cutscene disableUserInput false;

Additional Information

See also:
userInputDisabledenableSimulationenableSimulationGlobal

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
Posted on 14 March 2014
Killzone_Kid
Sometimes, when disableUserInput true command is invoked while the user is holding a button, when disableUserInput false is called and the user is no longer holding the button, the input will resume as if the user is still holding the button. To reset this behaviour, disable and enable user input again in the same frame: disableUserInput true; //do something disableUserInput false; disableUserInput true; disableUserInput false; Unfortunately, if the user is moving mouse when disableUserInput true command is invoked, the mouse input will get stuck for the whole duration of disabled user input but will reset as soon as disableUserInput false is called. I was unable to find workaround for this one.

UPDATE: There is now userInputDisabled command, which allows one to check if user input is still disabled after enabling it, so that one can retry until enabling is successful.