Thanks for the tip Matt. Though I feel the old (deprecated) way of
doing things was much clearer and easier to understand and code. I'm
not really sure why they changed it.

On Sep 1, 9:03 am, Mat Gessel <[email protected]> wrote:
> What, you want to read properties from the Event? Absurd!
>
> // (disclaimer: hand written in Gmail)
> HanderRegistration reg = Event.addNativePreviewHandler(new
> NativePreviewHandler()
> {
>   public void onPreviewNativeEvent(NativePreviewEvent event)
>   {
>     Event event0 = Event.as(event.getNativeEvent());
>     if (event0.getTypeInt() == Event.ONKEYDOWN)
>     {
>       int keyCode = event0.getKeyCode();
>       if (condition) // optional
>       {
>         event.cancel();
>       }
>     }
>   }
>
> });
>
> --
> Mat Gesselhttp://www.asquare.net
>
>
>
> On Mon, Aug 31, 2009 at 6:29 AM, monkeyboy<[email protected]> wrote:
>
> > In my code I am using onKeyDownPreview to hide a popup when the escape
> > key is hit.
> >    public boolean onKeyDownPreview(char key, int modifiers) {
> >        switch (key) {
> >            case KeyCodes.KEY_ESCAPE:
> >                hide();
> >                break;
> >        return true;
> >    }
> > But the onKeyDownPreview is deprecated and I was wandering how would a
> > version with onPreviewNativeEvent (the new way of handling events)
> > would look like? Any suggestions? Am I the only one to think that the
> > Google documentation about this is too terse?
--~--~---------~--~----~------------~-------~--~----~
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