Hi Alfred,

May be you can the sink the key events in the DialogBox and then handle it
in the onBowserEvent method. Like:

*class* KeyHandlingDialogBox *extends* DialogBox {

      *public* KeyHandlingDialogBox() {

            *super*();

            sinkEvents(Event.*KEYEVENTS*);

      }



      *public* *void* onBrowserEvent(Event event) {

            *super*.onBrowserEvent(event);

            *switch* (DOM.*eventGetType*(event)) {

            *case* Event.*ONKEYDOWN*:

                  // Do something

                  *break*;

            *case* Event.*ONKEYPRESS*:

                  // Do something

                  *break*;

            *case* Event.*ONKEYUP*:

                  // Do something

                  *break*;

            }

      }

}

Similarly for F2 handling may be you can sink and handle the events inside
the class which implements your base page. i.e. have a class that extends
may be the AbsolutePanel and add sinkEvents and onBrowserEvent to that. Now
add your widgets to this panel and add this panel to ur RootPanel. I think
tht shud work.

Hope this helps.

Regards,
Litty Preeth

On Fri, Jan 9, 2009 at 1:40 AM, Alfred S <[email protected]> wrote:

>
> This might seem like a silly question, but I've been unable to find an
> answer...
>
> Where do I attach a KeyboardListener that would affect either:
> -A DialogBox [pop up a dialog box, press a button, trigger an event
> anywhere in the pop up]
> -The RootPanel [I press F2 and it mimics a clicking a button]
>
> I know you can attach KeyboardListeners to buttons, but they only
> trigger if the button is selected.  How do I get around this?  Please
> help!
>
> Thanks,
> ~Alfred
> >
>

--~--~---------~--~----~------------~-------~--~----~
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