How to tell if a widget has focus?


08-03-2010 22:10:55

I cant find any 'hasFocus' method, and I need to know if a particular edit box has focus or not (so I can tell some other systems to ignore key presses while you are typing).

How can you tell if a particular widget (edit box in this case) has focus?


08-03-2010 22:33:37

if (myEdit == MyGUI::InputManager::getInstance().getMouseFocusWidget()) {/* do something */}
if (myEdit == MyGUI::InputManager::getInstance().getKeyFocusWidget()) {/* do something */}