- public boolean onKeyDownPreview(char key, int modifiers) {
- // Use the popup's key preview hooks to close the dialog when either
- // enter or escape is pressed.
- switch (key) {
- case KeyboardListener.KEY_ENTER:
- GSS.get().authenticateUser();
- hide();
- break;
- case KeyboardListener.KEY_ESCAPE:
- hide();
- break;
- }
- return true;
+ protected void onPreviewNativeEvent(NativePreviewEvent preview) {
+ super.onPreviewNativeEvent(preview);
+
+ NativeEvent evt = preview.getNativeEvent();
+ if (evt.getType().equals("keydown"))
+ // Use the popup's key preview hooks to close the dialog when either
+ // enter or escape is pressed.
+ switch (evt.getKeyCode()) {
+ case KeyCodes.KEY_ENTER:
+ GSS.get().authenticateUser();
+ hide();
+ break;
+ case KeyCodes.KEY_ESCAPE:
+ hide();
+ break;
+ }