Fix focus movement in ui::Entry widget on Mac OS X platform

This commit is contained in:
David Capello 2014-09-09 09:52:37 -03:00
parent a7c752116b
commit c37958a7f3
3 changed files with 20 additions and 2 deletions

View File

@ -279,6 +279,9 @@ bool Entry::onProcessMessage(Message* msg)
case kKeyV: cmd = EntryCmd::Paste; break;
}
}
else if (getManager()->isFocusMovementKey(msg)) {
break;
}
else if (keymsg->unicodeChar() >= 32) {
// Ctrl and Alt must be unpressed to insert a character
// in the text-field.

View File

@ -1029,6 +1029,20 @@ void Manager::removeMessageFilterFor(Widget* widget)
}
}
bool Manager::isFocusMovementKey(Message* msg)
{
switch (static_cast<KeyMessage*>(msg)->scancode()) {
case kKeyTab:
case kKeyLeft:
case kKeyRight:
case kKeyUp:
case kKeyDown:
return true;
}
return false;
}
/* configures the window for begin the loop */
void Manager::_openWindow(Window* window)
{

View File

@ -24,8 +24,7 @@ namespace ui {
class Timer;
class Window;
class Manager : public Widget
{
class Manager : public Widget {
public:
static Manager* getDefault() {
return m_defaultManager;
@ -79,6 +78,8 @@ namespace ui {
LayoutIO* getLayoutIO();
bool isFocusMovementKey(Message* msg);
void _openWindow(Window* window);
void _closeWindow(Window* window, bool redraw_background);