userInputDisabled: Difference between revisions
Lou Montana (talk | contribs) (Add stack example, thanks OverlordZorn) |
Lou Montana (talk | contribs) (Add example fixing an issue on held key) Tag: Reverted |
||
Line 30: | Line 30: | ||
disableUserInput false; | disableUserInput false; | ||
diag_log str userInputDisabled; // false - control is regained only here | diag_log str userInputDisabled; // false - control is regained only here | ||
</sqf> | |||
|x3= 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 | |||
</sqf> | </sqf> | ||
|seealso= [[disableUserInput]] | |seealso= [[disableUserInput]] | ||
}} | }} |
Revision as of 16:31, 13 April 2025
Description
- Description:
- Returns whether or not user input is disabled.
- Groups:
- Interaction
Syntax
- Syntax:
- userInputDisabled
- Return Value:
- Boolean
Examples
- Example 1:
- Toggles user input
- Example 2:
- disableUserInput true; disableUserInput true; disableUserInput true; diag_log str userInputDisabled; // true disableUserInput false; diag_log str userInputDisabled; // true disableUserInput false; diag_log str userInputDisabled; // true disableUserInput false; diag_log str userInputDisabled; // false - control is regained only here
- Example 3:
- 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
Additional Information
- See also:
- disableUserInput
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