Thanks Y2i!
Event.addNativePreviewHandler() does it (see code below)! However,
alt, ctrl, and meta doesn't seam to work (shift works)!? Since
FocusWidget.setAccessKey(char) handles key combos with the alt key GWT
should be able to listen for alt, right? But how? And how do I handle
ctrl and meta? (I have tested this with devmode and Chrome.)
Event.addNativePreviewHandler(new Event.NativePreviewHandler() {
public void onPreviewNativeEvent(NativePreviewEvent event) {
NativeEvent ne = event.getNativeEvent();
GWT.log(ne.getCharCode() + " (" + ((char) ne.getCharCode()) +
") " +
(ne.getButton() != 1 ? " button=" +
ne.getButton() : "") +
(ne.getKeyCode() != ne.getCharCode() ? "
keyCode=" +
ne.getKeyCode() : "") +
(ne.getAltKey() ? " ALT" : "") +
(ne.getCtrlKey() ? " CTRL" : "") +
(ne.getMetaKey() ? " META" : "") +
(ne.getShiftKey() ? " SHIFT" : ""));
}
});
On Sep 19, 8:34 am, Y2i <[email protected]> wrote:
> Have you tried Event.addNativePreviewHandler()
> <http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/googl...)>
> ?
On Sep 19, 8:34 am, Y2i <[email protected]> wrote:
> Have you tried Event.addNativePreviewHandler()
> <http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/googl...)>
> ?
--
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.