disable caps lock detection for soft keyboards (mobile browsers)

Viewed 211

For password inputs I have some JavaScript which checks if caps lock is pressed so as to warn the user. It uses the "standard" way of doing this -- looking at keyboardEvent.keyCode and keyboardEvent.shiftKey (and some other nonsense for ancient browsers).

The problem is this is annoying for mobile users (at least iOS, no reports from Android people) because "caps lock" is the normal way one gets a capital letter.

Currently I am using some grievous user agent sniffing to disable this, but I am feeling there has to be a less fragile way of knowing that this is a soft (mobile) keyboard and caps lock for uppercase is the normal way of things (so I quit bellyaching about it!)

1 Answers
Related