Ya, but the user might just be holding the shift key and is
intentionally entering capitol letters. The reality is that there
STILL is no way to directly detect in a browser whether the capslock
button is on/off.

However, I believe it is possible to deduce this logically depending
on whether the shift key is depressed or not. I researched this in the
past, and if I remember correctly the only event that CORRECTLY gives
the keycode in upper/lower case is the onKeyPress event. IOW, during
the onKeyDown and onKeyUp events the keycode ALWAYS gives capitol
letters, regardless of what the user typed.

So this solution is far from perfect because you can only do this
detection when the user types a key... you can't warn them before
they've even started typing. I don't think there is any way to
logically deduce that when they hit caps lock button to turn it off,
that they in fact did hit that button. So your warning won't go away
until they start typing regular characters again. Also, your logic
can't tell when they are entering non-alpha numeric keys, so your
warning may stay even longer depending on their password.

Do a google search for "javascript detect capslock" and you will find
JS that you can easily convert to GWT code, but as I've explained,
it's far from being very useful.

Not to mention detecting the shift key might be quirky across browsers
and OS's... I'm not sure. I just know that sometimes when I'm
detecting keys and I've done my research on compatibility that not
everything is consistently supported.

It's very very sad :(

On Jun 12, 11:40 am, aditya sanas <007aditya.b...@gmail.com> wrote:
> Hello,
>
> You can either register textbox with onkeyuphandler which will give access
> to each keycode entered by using that if character entered is from A-Z that
> you can check as A has value 65...
>
> In this way you can achieve what you are trying to do and to show a message
> you can use anything as per your requirement.
>
> I hope this will solve your issue.
>
> Cheers,
> --
> Aditya
>
>
>
> On Sat, Jun 12, 2010 at 2:53 PM, gopal <gopalbhal...@gmail.com> wrote:
> > I have some code for login page.
> > There are one dynamic have TextItem and PasswordItem.
>
> > Now when user enter some keys in this textitem or password field i
> > want to set warning for capsLock is on or off on both.
>
> > How can i set this?
>
> > Please give me some proper reply on this i m try to 2-3 days for this.
>
> > Please reply earliest.
>
> > Thanking You.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to google-web-tool...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2Bunsubs 
> > cr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to