Hi,

I think what you want can be done by calling
sinkEvents(Event.ONKEYPRESS) in the constructor and overriding
onBrowserEvent() like so:

@Override
public void onBrowserEvent(Event event) {
   super.onBrowserEvent(event);
   if(event.getTypeInt == Event.ONKEYPRESS) {
      // your logic here
   }
}

Maybe you need ONKEYDOWN and not ONKEYPRESS.

On May 23, 8:38 pm, zip184 <[email protected]> wrote:
> I have a MenuBar item Command that needs to know the current state of
> the keyboard.  I basically need to detect whether the Ctrl is down and
> I don't have access to any KeyPressEvent that I'm aware of.
>
> I added the item with MenuBar.addItem(String, Command).  The Command
> is where the code is that needs this information.  Is there any client
> API that can get access to the current state of the user's mouse /
> keyboard state?

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