views:

66

answers:

1

Language: Java/GWT Platform: Ubuntu/Firefox

I need to listen for arrow keys pressed in a TextBox. It seems that pressing up and down does not generate keypressevents for some reason. Instead I tried giving focus to a focus panel, handling the arrow keys and passing any other events to the TextBox, but the delegation has no effect. I've tried:

ChangeEvent.fireNativeEvent(focusPanelEvent.getNativeEvent(), textBox);

and

textBox.fireEvent(focusPanelEvent);

and

private class DelegatingFocusPanel extends FocusPanel {
   public void delegate(Widget target, GwtEvent event) {
      super.delegateEvent(target, event);
   }
}

public void onKeyPress(KeyPressEvent event) {
   focusPanel.delegate(textBox, event);
}

Any other ideas?

A: 

I ended up rebuilding my example from scratch and it worked, so I don't know what I did wrong. Thank you for those who put any thought into it.

Momo Nanty