disableUserInput: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "|Game version=" to "|Game version= |gr1= GUI Control |GROUP1= ") |
Lou Montana (talk | contribs) m (Text replacement - "<sqf>([^↵][^<]*↵[^<]*)<\/sqf>" to "<sqf> $1 </sqf>") |
||
(51 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
| ofp | | |game1= ofp | ||
|version1= 1.00 | |||
|1.00 | |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= arma3 | ||
|version7= 0.50 | |||
| | |gr1= Interaction | ||
| | |eff= local | ||
| [[ | |descr= 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.}} | ||
|s1= [[disableUserInput]] state | |||
| | |||
|p1= state: [[Boolean]] - [[true]] to disable, [[false]] to enable | |||
|r1= [[Nothing]] | |||
|x1= <sqf> | |||
disableUserInput true; | |||
// cutscene | // cutscene | ||
disableUserInput false; | |||
</sqf> | |||
|seealso= [[userInputDisabled]] [[enableSimulation]] [[enableSimulationGlobal]] | |||
}} | }} | ||
<dl class="command_description"> | <dl class="command_description"> | ||
< | |||
<dd class="notedate">Posted on 14 March 2014 | <dt></dt> | ||
<dt class="note> | <dd class="notedate">Posted on 14 March 2014</dd> | ||
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]</dt> | |||
<dd class="note"> | <dd class="note"> | ||
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: | 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: | ||
< | <sqf> | ||
disableUserInput true; | |||
//do something | //do something | ||
disableUserInput false; | |||
disableUserInput true; | |||
disableUserInput false; | |||
</sqf> | |||
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. | 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. | ||
</dl> | </dl> | ||
Latest revision as of 19:42, 3 September 2024
Description
- Description:
- Disables or enables the keyboard and mouse input. Usually used during cutscenes.
- Groups:
- Interaction
Syntax
- Syntax:
- disableUserInput state
- Parameters:
- state: Boolean - true to disable, false to enable
- Return Value:
- Nothing
Examples
- Example 1:
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
- 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:
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.
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Interaction
- Scripting Commands: Local Effect