disableUserInput: Difference between revisions
Jump to navigation
Jump to search
(see also) |
Killzone Kid (talk | contribs) (warning added) |
||
Line 9: | Line 9: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | Disables or enables the keyboard and mouse input. Usually used during cutscenes.<br><br> | ||
{{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.}} |= Description | |||
<br><br>Be careful with the usage of this command | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| '''disableUserInput''' state |= Syntax | | '''disableUserInput''' state |= Syntax | ||
|p1= state: [[Boolean]] |= Parameter 1 | |p1= state: [[Boolean]] - [[true]] to disable, [[false]] to enable|= Parameter 1 | ||
| [[Nothing]] |= Return value | | [[Nothing]] |= Return value | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= < | |x1= <code>[[disableUserInput]] [[true]]; | ||
// cutscene | |||
[[disableUserInput]] [[false]];</code> |= Example 1 | |||
disableUserInput false</ | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[ | | [[userInputDisabled]], [[enableSimulation]], [[enableSimulationGlobal]] |= See also | ||
}} | }} | ||
Line 45: | Line 43: | ||
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. | 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. | ||
<br><br> | <br><br> | ||
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. | |||
<!-- Note Section END --> | <!-- Note Section END --> | ||
</dl> | </dl> |
Revision as of 23:47, 20 January 2019
Description
- Description:
- Disables or enables the keyboard and mouse input. Usually used during cutscenes.
- Groups:
- Uncategorised
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
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
Notes
- 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.
Bottom Section
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Command Group: Uncategorised
- Scripting Commands: Local Effect
- Scripting Commands OFP 1.99
- Scripting Commands OFP 1.96
- Scripting Commands OFP 1.46
- Scripting Commands ArmA
- Command Group: GUI Control
- Command Group: Interaction
- Scripting Commands ArmA2
- Scripting Commands Arma 3
- Scripting Commands Take On Helicopters