On 5 nov, 12:10, Sorinel C <[email protected]> wrote:
> - Open this page:http://www.quirksmode.org/js/keys.html with both
> browsers (Internet Explorer and Firefox).
> - Choose the "keypress" event for Testing.
> - Click on a numeric key (0,1,2,3 ... 9)
>
> You'll see that the FF and IE have different results.
>
> * IE for key "2"
> keypress
> keyCode is 50
> charCode is undefined
>
> * FF for key "2"
> keypress
> keyCode is 0
> charCode is 50
>
> * Chrome for key "2"
> keypress
> keyCode is 50
> charCode is 50
>
> So, it seems that Chrome is the nicest browser here -- but why do we
> have this discrepancy?  shouldn't the Event class (which is a wrapper
> on NativeEvent) provide the same results like Chrome for any browser?

Given that the keyCode in keydown and keyup events is 98, it SHOULD be
98 in keypress too. As PPK says, IE has the most "reasonable"
implementation here.
You'll find issues in the bug tracker about these discrepancies, but
really they're not easy to solve (particularly re. repeated events,
and differences between platforms (for the same browser, because of
the differences at the OS level))

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

Reply via email to