Unfocus element on click.

This commit is contained in:
sonicx 2016-02-29 18:14:52 +01:00
parent c195a202f2
commit fad6f63064
1 changed files with 2 additions and 1 deletions

View File

@ -2930,12 +2930,13 @@ bool GUIFormSpecMenu::preprocessEvent(const SEvent& event)
}
}
}
if (event.EventType == EET_MOUSE_INPUT_EVENT &&
event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN) {
gui::IGUIElement *focused = Environment->getFocus();
if(focused && isMyChild(focused)) {
if(getTypeByID(focused->getID()) == f_KeyEventBox) {
setInitialFocus();
Environment->setFocus(NULL);
return true;
}
}