disableUserInput: Difference between revisions
Lou Montana (talk | contribs) m (Text replacement - "{{Feature | Warning | " to "{{Feature|warning|") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(One intermediate revision by the same user not shown) | |||
Line 34: | Line 34: | ||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
|x1= <sqf>disableUserInput true; | |x1= <sqf> | ||
disableUserInput true; | |||
// cutscene | // cutscene | ||
disableUserInput false;</sqf> | 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]] | |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:
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
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