disableUserInput: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Note on strange behaviour and workaround.)
Line 11: Line 11:
| Disable and enable the keyboard and mouse input, usually used during cutscenes.
| 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
<br><br>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
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 27: Line 27:
____________________________________________________________________________________________
____________________________________________________________________________________________


| |= See also
| [[enableSimulation]], [[enableSimulationGlobal]] |= See also


}}
}}
Line 34: Line 34:
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on 14 March 2014
<dt class="note>'''[[User:Killzone_Kid|Killzone_Kid]]'''
<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:
<code>[[disableUserInput]] [[true]];
//do something
[[disableUserInput]] [[false]];
[[disableUserInput]] [[true]];
[[disableUserInput]] [[false]];</code>
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>
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>

Revision as of 18:14, 16 March 2014

Hover & click on the images for description

Description

Description:
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.
Groups:
Uncategorised

Syntax

Syntax:
disableUserInput state
Parameters:
state: Boolean
Return Value:
Nothing

Examples

Example 1:
disableUserInput true
; cutscene

disableUserInput false

Additional Information

See also:
enableSimulationenableSimulationGlobal

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.

Bottom Section