I tried three ways:
1.)
function OnGUI() {
var e : Event = Event.current;
Debug.Log(e.capsLock) ;
}
2.)
function Update(){
if (Input.GetKey(KeyCode.CapsLock)) {
Debug.Log("true");
}
else
{
Debug.Log("false");
}
}
3.)
import System;
function Update () {
print(Console.CapsLock);
}
The first two give me true on when CappsLock is CONSTANTLY PRESSED regardless of it is on or off. The third gives false always.
All three give false even if CapsLock is on. Why? I have win7 x64 .NET 2.0.
I wanna use it for hidden password warning to the end-user by the program in a form: “Beware, your Caps is on!”