Looks like you're getting the wrong type from KeyPressEvent.  Javadoc
says:

getAssociatedType()
          Returns the type used to register this event.

getType()
          Gets the event type associated with key press events.

for registering, you should use getAssociatedType(), so try

eventBus.addHandler(KeyPressEvent.getAssociatedType(), ....

On May 31, 1:54 pm, justint <[email protected]> wrote:
> Hi,  I'm fairly new to GWT and I'm trying to add events to my
> "eventBus"...
>
> final HandlerManager eventBus = new HandlerManager(null);
> ..
>
>                 eventBus.addHandler(RequestEvent.TYPE, new 
> RequestEvent.Handler() {
>                         public void onRequestEvent(RequestEvent requestEvent) 
> {
>                                 if (requestEvent.getState() == State.SENT) {
>                                         System.out.println("RPC sent!");
>                                 }
>                         }
>                 });
>
> This RequestEvent event works fine, but this doesn't work for
> instance...or at least I don't think it works:
>                 eventBus.addHandler(KeyPressEvent.getType(), new 
> KeyPressHandler()
> {
>                         public void onKeyPress(KeyPressEvent arg0) {
>                                 System.out.println("Key pressed event!");
>                         }
>                 });
>
> Any tips are greatly appreciated!

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