You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 8, 2017. It is now read-only.
It'd be awesome if you were able to detect the status of Caps Lock. A typical use case would be a log in screen where the password is case sensitive and being able to present an alert to the user when it's active.
This link supposedly does this but not in a very pretty manor.
I think the best way to do this would be to extend a capsLock property inside a keyboard event, which will be similar to shiftKey.
The problem is, it seems as though the only way to detect a caps lock event is if a keyboard event is generating a capital letter, but shiftKey is false. This seems somewhat unreliable, and won't work for non-printable characters, which means if the property is always inside the keyboard event, it may give a false positive (or false negative).
Also it seems like caps-lock behaviour is undecided among browsers. For example Chrome on Mac will only fire the caps lock key when it switches onto caps lock. Firefox, however, will fire regardless of state.
That is not to say no, but I think it is worth putting more research in to get a good idea of how best to implement it.
It'd be awesome if you were able to detect the status of Caps Lock. A typical use case would be a log in screen where the password is case sensitive and being able to present an alert to the user when it's active.
This link supposedly does this but not in a very pretty manor.
http://www.codeproject.com/KB/scripting/Detect_Caps_Lock.aspx
The text was updated successfully, but these errors were encountered: