disableUserInput: Difference between revisions

From Bohemia Interactive Community
m (Dangerous command)
m (Some wiki formatting)
 
(78 intermediate revisions by 13 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| ofp |= Game name
|game1= ofp
|version1= 1.00


|1.00|= Game version
|game2= ofpe
|version2= 1.00


|eff= local |= Effects in MP
|game3= arma1
____________________________________________________________________________________________
|version3= 1.00


| Disable and enable the keyboard and mouse input, usually used during cutscenes. Be careful with the usage of this command, always remember to enable the user input again, as once the user input is disabled, you can only shut down OFP but not exit the mission with escape |= Description
|game4= arma2
____________________________________________________________________________________________
|version4= 1.00


| '''disableUserInput''' state |= Syntax
|game5= arma2oa
|version5= 1.50


| [[Nothing]] |= Return value
|game6= tkoh
____________________________________________________________________________________________
|version6= 1.00
 
|x1= <pre>disableUserInput true
; cutscene


disableUserInput false</pre> |= Example 1
|game7= arma3
____________________________________________________________________________________________
|version7= 0.50


| |= See also
|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
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


<h3 style="display:none">Notes</h3>
disableUserInput true;
<dl class="command_description">
disableUserInput false; // this resets released keys making the issue invisible
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on September 15, 2006 - 07:51</dd>
<dt class="note">'''[[User:Str|Str]]'''</dt><dd class="note">{{Important|It's higly recommended to not use this command in any case!}}</dd>
<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
// this workaround does not fix the mouse input that may get stuck on [[disableUserInput]] call
</sqf>


[[Category:Scripting Commands|DISABLEUSERINPUT]]
|seealso= [[userInputDisabled]] [[enableSimulation]] [[enableSimulationGlobal]]
[[Category:Scripting Commands OFP 1.96|DISABLEUSERINPUT]]
}}
[[Category:Scripting Commands OFP 1.46|DISABLEUSERINPUT]]
[[Category:Scripting Commands ArmA|DISABLEUSERINPUT]]

Latest revision as of 16:35, 13 April 2025

Hover & click on the images for description

Description

Description:
Disables or enables the keyboard and mouse input. Usually used during cutscenes.
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.
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;
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

See also:
userInputDisabled enableSimulation enableSimulationGlobal

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