I have code like the following in a DialogBox subclass that dismisses a
dialog box when the user presses the Escape key:
public boolean onKeyPressPreview(char key, int modifiers) {
if (key == 033) { // ESC
hide();
return false;
}
return true; // propagate event
}
This code worked in all browsers in 1.0.21. In 1.1, it still works in
hosted mode and in IE, but does not work in Firefox. Looking more
closely, the reason is that in Firefox the value of key is 0 when
Escape is pressed. Interestingly, the value is not always 0 -- most
key codes get sent correctly, but so far I've seen that ESC and tab
result in key being 0. Is this a known issue? As I mentioned, this
worked fine in 1.0.21.