I have created a custom widget in gwt which extends the composite.I am using focus panel in that.For FocusPanel I added ClickHandler.Then I have added keyboard listner.Now o
I have done this code:
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
myButton.fireEvent( new GwtEvent() {
@Override
public com.google.gwt.event.shared.GwtEvent.Type getAssociatedType() {
return ClickEvent.getType();
}
@Override
protected void dispatch(ClickHandler handler) {
handler.onClick(null);
}
});
}
Of course myButton must be final or public cause you are inside another event handler.