disableUserInput: Difference between revisions
Lou Montana (talk | contribs) m (Text replacement - " {2,}\}\}" to " }}") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(41 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 | |gr1= Interaction | ||
Line 9: | Line 26: | ||
|eff= local | |eff= local | ||
| Disables or enables the keyboard and mouse input. Usually used during cutscenes. | |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 | |p1= state: [[Boolean]] - [[true]] to disable, [[false]] to enable | ||
| [[Nothing]] | |r1= [[Nothing]] | ||
|x1= < | |x1= <sqf> | ||
disableUserInput true; | |||
// cutscene | // cutscene | ||
disableUserInput false; | |||
</sqf> | |||
| | |x2= Reset user input if a key was pressed: | ||
<sqf> | |||
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 | |||
</sqf> | |||
|seealso= [[userInputDisabled]] [[enableSimulation]] [[enableSimulationGlobal]] | |||
[[ | }} | ||
[[ | |||
[[ | |||
Latest revision as of 16:35, 13 April 2025
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:
- Example 2:
- Reset user input if a key was pressed:
CopydisableUserInput 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
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
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