2

Will there be any plan to implement caps lock detection in html5 or some other spec. This seems like a pretty simple functionality to be missing.

Sophie
  • 780
  • 6
  • 18

1 Answers1

2

Not that I know of. If you want to do it though this is a reasonable approach.

http://www.codeproject.com/Articles/17180/Detect-Caps-Lock-with-Javascript

Basically the idea is to just test if the letter is capital or not and to compare the result with whether or not the shift key was pressed when typing. There is no way that I am aware of to detect CAPS lock right off the bat in a web application.

Levi Botelho
  • 24,626
  • 5
  • 61
  • 96
  • Thanks, I've heard about that approach before, unfortunately, it is difficult to use this approach when creating something like a virtual keyboard. – Sophie Oct 27 '12 at 19:30
  • 1
    I see. The best bet would probably then be to try and use clever user interface design to get the user to type SOMETHING on your page. Once they are there then you can track the use of CAPS no problem. Would completely depend on your site though of course. – Levi Botelho Oct 27 '12 at 20:05