{"name":"disableUserInput","operator":null,"title":"disableUserInput","type":"command","url":"https://community.bistudio.com/wiki/disableUserInput","revid":373274,"updated":"2025-04-13T14:35:36Z","groups":["Interaction"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":"local","server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"state","type":"Boolean","optional":false,"default":null,"description":"true to disable, false to enable","types":["Boolean"],"since":null,"text":"state: Boolean - true to disable, false to enable"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"unary","operator":null,"left":null,"right":{"text":"state","types":["Boolean"]}}],"examples":[{"text":"```sqf\ndisableUserInput true;\n// cutscene\ndisableUserInput false;\n```","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"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["userInputDisabled","enableSimulation","enableSimulationGlobal"],"notes":[],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Interaction","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Scripting Commands: Local Effect","Take On Helicopters: Scripting Commands"]}