Skip to content
This repository has been archived by the owner on Nov 8, 2017. It is now read-only.

Caps lock detection #8

Open
tomcooksey opened this issue Dec 21, 2011 · 2 comments
Open

Caps lock detection #8

tomcooksey opened this issue Dec 21, 2011 · 2 comments

Comments

@tomcooksey
Copy link

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

@keithamus
Copy link
Owner

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.

@keithamus keithamus reopened this Dec 21, 2011
@keithamus
Copy link
Owner

Grr the "close and comment" and "comment" buttons being next to each-other is super irritating

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants