Wednesday, August 27, 2014

Handle escape key event on PopupPanel GWT 2.5.1

Hi everyone...i have a problem with handling the escape key event.
I have a popup panel and i want to intercept the keydown event when the escape button is pressed.
I override the "onPreviewNativeEvent" in order to manage the event (i want to hide the panel)
This is the snippet code

protected void onPreviewNativeEvent(NativePreviewEvent event) {
int type = event.getTypeInt();
if (!event.isCanceled()) {
if (type == Event.ONKEYDOWN) {
int keyCode = event.getNativeEvent().getKeyCode();
// ESC clicked
if (keyCode == KeyCodes.KEY_ESCAPE) {

But it seems that nothing works when i hit the button on the keyboard (only for the escape button. If i press another button the event is intercepted and everything works very well)
I can't understand where is the problem.

My application works on Internet Explorer 10 (and it must work only for Microsoft's browsers)

Thank you


You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment