Ok, figured it out - DOM#addEventPreview is deprecated but
Event#addNativePreviewHandler does the same thing:

                // handle key up
                Event.addNativePreviewHandler(new Event.NativePreviewHandler() {
                        @Override
                        public void onPreviewNativeEvent(NativePreviewEvent 
event) {
                                if (event.getTypeInt() == Event.ONKEYUP) {
                                        // do something with the keycode
                                        // 
doSomething(event.getNativeEvent().getKeyCode());

                                        event.cancel();
                                }
                        }
                });

If the above code doesn't display properly, it's also a gist on GitHub
- http://gist.github.com/171494


On Aug 20, 3:05 pm, bosco monkey <[email protected]> wrote:
> In plain JavaScript, it's trivial to hook a key up handler to
> window.document. But in GWT, I can't seem to add a KeyUpHandler to
> Document.get().
>
> Is there a quick & easy way?
>
> Or do I have to add the mess that's describe here -http://bit.ly/If5jK
--~--~---------~--~----~------------~-------~--~----~
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