disable keyboard

Hi.
How can I disable keyboard in unity3D ?
I have two scene and I want keyboard to be disabled when I switch to the second scene. And it doesn’t get any keyboard input from the player, since it effects the functions related to the first scene like movement of the player in the first scene.
Thanks in advanced.

I don’t think that’s possible to ‘totally disable the keyboard’. And, even if I can’t look at your code, I’m pretty sure that it could exists a more reasonable solution at your problem. However, if you have a few number of keys that you wanna deactivate (as you said, just the key arrows and a little more set of buttons - for which it corresponds an action), you can use a script that prevents the action (corresponding to a button) to be performed. Look at the code by AngryAnt here: http://forum.unity3d.com/threads/25033-how-to-disable-a-keyboard-key.

I’m new to Unity and Scripting but maybe this might work.

When a level loads where you want to use the keyboard controls set a variable to True.
var UseKeyboard = true;

When a level loads where you don’t want to use the keyboard controls set the variable to false

var UseKeyboard = false;

Use that variale in your controls.

if (UseKeyboard == true);

{

//Controls here

}

This kind of logic may work. Doesn’t have to be like this but using a varible to toggle your controls on and off may work.