{"name":"disableUserInput","title":"disableUserInput","type":"command","url":"https://community.bistudio.com/wiki/disableUserInput","revid":373274,"updated":"2025-04-13T14:35:36Z","groups":["Interaction"],"status":"ok","games":{"ofp":"1.00","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.00","arma3_since":"0.50","locality":{"effect":"local"},"description":"Disables or enables the keyboard and mouse input. Usually used during cutscenes.\n\n> [!WARNING]\n> 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.","syntaxes":[{"syntax":"disableUserInput state","params":[{"name":"state","type":"Boolean","description":"true to disable, false to enable","type_expr":"Boolean"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"state"}}],"examples":[{"code":["disableUserInput true;\n// cutscene\ndisableUserInput false;"]},{"text":"Reset user input if a key was pressed:\n\n```sqf\ndisableUserInput true;    // here e.g W was pressed\nsleep 2;                // the user releases keys\ndisableUserInput false;    // the game considers W is still pressed as it did not listen to a \"KeyUp\" event\n\ndisableUserInput true;\ndisableUserInput false;    // this resets released keys making the issue invisible\n\n// this workaround does not fix the mouse input that may get stuck on disableUserInput call\n```","code":["disableUserInput true;\t// here e.g W was pressed\nsleep 2;\t\t\t\t// the user releases keys\ndisableUserInput false;\t// the game considers W is still pressed as it did not listen to a \"KeyUp\" event\n\ndisableUserInput true;\ndisableUserInput false;\t// this resets released keys making the issue invisible\n\n// this workaround does not fix the mouse input that may get stuck on disableUserInput call"]}],"see_also":["userInputDisabled","enableSimulation","enableSimulationGlobal"]}