- Home /
Web player - How to check the initial state of caps lock?
I want to grab some text input from the user through the Unity WebPlayer.
On Windows, there are no issues, as Input.inputString takes caps into account. However, on Mac, Input.inputString is broken (see here).
In order to get around this, I created a script that runs on RuntimePlatform.OSXWebPlayer that calls Input.GetKey() on all desired characters every frame.
The only issue with this is that I do not know the state of caps lock when the web player starts. As mentioned here:
KeyCode.CapsLock and Event.capsLock only returns True if the key is pressed, not returning the state of the lock. There would be a way with importing System.Console namespace with the CapsLock function but Unity doesn't seem to import it... Must be some kind of a security issue. I also could take a use of it but couldn't find an answer yet.
Does anyone know of a way to tell whether or not caps lock is on at the start of a webplayer? Or would there be any other way to get user input on Mac which takes caps lock into account?
Thanks.
Are there any updates on this? I am wondering the same thing.
Your answer
![](https://koobas.hobune.stream/wayback/20220613133754im_/https://answers.unity.com/themes/thub/images/avi.jpg)