No matter how the different browsers implement key events, I believe
that since
GWT is supposed to cover up for the browsers incompatibilities, it has
to provide a
consistend handling of the key events in all cases.

My personal, user-side opinion is that the e.charCode field of the
NativeEvent or at
least getCharCode() method of the KeyPressEvent should return only the
char code
in case when a printable key was generated, i.e a button was pressed
that has a letter
on it. The e.keyCode and of the NativeEvent or at least getKeyCode()
of the KeyPressEvent
must consistently return the key codes of the pressed button but by no
means char codes.

In other words one should not mix slugs with oranges. There are
generated printable char codes
that should be printed on the screen and there are button key codes
that identify the buttons that
were clicked.

On Jun 17, 12:12 pm, Thomas Broyer <[email protected]> wrote:
> [Cc'ing John as he is the owner for keyboard-related issues 1061 and
> 1529]
>
> Issue 3753 has been reported a few hours ago.
>
> http://code.google.com/p/google-web-toolkit/issues/detail?id=3753
>
> When I saw it, I immediately thought "this is a dupe" and "we all know
> what should have been done, it's just a problem with backwards
> compatibility of GWT apps that justifies GWT is still broken".
> So I searched the issues and didn't actually find what I remembered
> sawing in a PPK presentation earlier this year (see my comment on the
> issue for pointers and the "what GWT should have done" thing).
>
> My proposal:
>  - fix KeyPressEvent::getCharCode
>  - do *not* fix the fact that FF and Opera do not follow the IE/Safari
> model (AFAICT, the W3C has finally settled on a model very similar --
> if not identical-- to the IE/Safari one)
>  - fix NativeEvent::getKeyCode (actually DOMImpl::eventGetKeyCode) not
> no longer use event.which (seehttps://developer.mozilla.org/en/DOM/event.which
> ) and eventually add a NativeEvent::getCharCode to back
> KeyPressEvent::getCharCode.
>  - eventually take advantage of the deferred binding already in place
> on DOMImpl to use either e.keyCode or e.charCode for getCharCode
> (eventGetCharCode?) instead of (e.keyCode || e.charCode)
>
> Any thoughts?

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to