Avoid using ESC key to close non-foreground windows

This commit is contained in:
David Capello 2015-05-11 09:53:45 -03:00
parent 300a5cc1cb
commit 1583cd82bd

View File

@ -80,14 +80,16 @@ protected:
return true;
case kKeyDownMessage:
if (static_cast<KeyMessage*>(msg)->scancode() == kKeyEsc) {
if (getRoot()->isForeground() &&
static_cast<KeyMessage*>(msg)->scancode() == kKeyEsc) {
setSelected(true);
return true;
}
break;
case kKeyUpMessage:
if (static_cast<KeyMessage*>(msg)->scancode() == kKeyEsc) {
if (getRoot()->isForeground() &&
static_cast<KeyMessage*>(msg)->scancode() == kKeyEsc) {
if (isSelected()) {
setSelected(false);
closeWindow();