The method described by DLH should work and except for the detail argument (which I have no idea what's it for) you have the other arguments available in the KeyPressEvent.
Another possible solution is to call the native JavaScript click()
on the element. I've done this in a Button widget (Which is available as open source). See click()
method in the following class: http://code.google.com/p/cobogw/source/browse/trunk/widgets/src/main/java/org/cobogw/gwt/user/client/ui/Button.java), which calls a specific Event2 class, that implements the browser specific versions of the click method.
To use this method, you could simply add the jar file provided with cobogw to your project, include the Event.gwt.xml
and call Event2.fireClickEvent(getElement());
in your method or only use the code from the classes Event2 and Event in your own project
This solution also allows you the programmatically fire a click event.
Also take a look at the onBrowserEvent
implementation in the Button class mentioned above , since it handles the key event in a similar way you want, and works around the problem of the firing of multiple key events, when you only want to generate 1 click event.