Re: KeyPressHandler problem

2009-09-07 Thread Thomas Broyer



On 5 sep, 19:55, joppi  wrote:
> How can I find out in TextBox in KeyPressHandler if user pressed
> delete or dot (for example), because event.getCharCode() returns same
> value.

keyboard events in JavaScript are a mess, because each browser has its
own handling and fires different events fro the same key strokes.
With the advent of DOM Level 3 Events, we can hope they converge to a
single interoperable model, but in the mean time, this is a mess:
http://www.w3.org/TR/DOM-Level-3-Events/keyset.html (replace textInput
with keypress it almost perfectly describes Internet Explorer's model)

Have a look to issue 3753 
http://code.google.com/p/google-web-toolkit/issues/detail?id=3753
and follow the links I gave there.

In the "ideal model", the "delete" key shouldn't generate a keypress
event, and should therefore only be detectable in keydown and keyup
events; and there, a dot would have a different key code than delete
(actually, there would be different codes depending on whether you
used the dot key from the numpad or not, or use a Alt+046 combination
on Windows –using the numpad–)
--~--~-~--~~~---~--~~
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-toolkit@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
-~--~~~~--~~--~--~---



KeyPressHandler problem

2009-09-05 Thread joppi

How can I find out in TextBox in KeyPressHandler if user pressed
delete or dot (for example), because event.getCharCode() returns same
value.

Thanks
Michal Opler

--~--~-~--~~~---~--~~
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-toolkit@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
-~--~~~~--~~--~--~---