Commit b5c52236 authored by cutealien's avatar cutealien

Change GUI-focus on TAB now after the active element got the TAB-key, so the...

Change GUI-focus on TAB now after the active element got the TAB-key, so the element has a chance to prevent focus-changes.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3757 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 1f1df157
...@@ -575,7 +575,11 @@ bool CGUIEnvironment::postEventFromUser(const SEvent& event) ...@@ -575,7 +575,11 @@ bool CGUIEnvironment::postEventFromUser(const SEvent& event)
break; break;
case EET_KEY_INPUT_EVENT: case EET_KEY_INPUT_EVENT:
{ {
// send focus changing event if (Focus && Focus->OnEvent(event))
return true;
// For keys we handle the event before changing focus to give elements the chance for catching the TAB
// Send focus changing event
if (event.EventType == EET_KEY_INPUT_EVENT && if (event.EventType == EET_KEY_INPUT_EVENT &&
event.KeyInput.PressedDown && event.KeyInput.PressedDown &&
event.KeyInput.Key == KEY_TAB) event.KeyInput.Key == KEY_TAB)
...@@ -587,11 +591,7 @@ bool CGUIEnvironment::postEventFromUser(const SEvent& event) ...@@ -587,11 +591,7 @@ bool CGUIEnvironment::postEventFromUser(const SEvent& event)
return true; return true;
} }
} }
if (Focus)
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return Focus->OnEvent(event);
}
} }
break; break;
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment