LLViewerWindow::handleKey(): More harmlessness (sync)

Handle Tabbing through elements/floaters earlier.
Combine g*Menu*View handleKey() checks.
This commit is contained in:
Inusaito Sayori
2013-10-22 09:08:41 -04:00
parent 45cd0157ef
commit 75ee99f4d5

View File

@@ -2706,7 +2706,6 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
toggle_debug_menus(NULL);
}
// handle shift-escape key (reset camera view)
if (key == KEY_ESCAPE && mask == MASK_SHIFT)
{
@@ -2714,16 +2713,32 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
return TRUE;
}
// let menus handle navigation keys
if (gMenuBarView && gMenuBarView->handleKey(key, mask, TRUE))
// let menus handle navigation keys for navigation
if ((gMenuBarView && gMenuBarView->handleKey(key, mask, TRUE))
|| (gLoginMenuBarView && gLoginMenuBarView->handleKey(key, mask, TRUE)))
{
return TRUE;
}
// let menus handle navigation keys
if (gLoginMenuBarView && gLoginMenuBarView->handleKey(key, mask, TRUE))
// give floaters first chance to handle TAB key
// so frontmost floater gets focus
// if nothing has focus, go to first or last UI element as appropriate
if (key == KEY_TAB && (mask & MASK_CONTROL || gFocusMgr.getKeyboardFocus() == NULL))
{
if (gMenuHolder) gMenuHolder->hideMenus();
// if CTRL-tabbing (and not just TAB with no focus), go into window cycle mode
gFloaterView->setCycleMode((mask & MASK_CONTROL) != 0);
// do CTRL-TAB and CTRL-SHIFT-TAB logic
if (mask & MASK_SHIFT)
{
mRootView->focusPrevRoot();
}
else
{
mRootView->focusNextRoot();
}
return TRUE;
}
@@ -2792,30 +2807,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
return TRUE;
}
// give floaters first chance to handle TAB key
// so frontmost floater gets focus
if (key == KEY_TAB)
{
// if nothing has focus, go to first or last UI element as appropriate
if (mask & MASK_CONTROL || gFocusMgr.getKeyboardFocus() == NULL)
{
if (gMenuHolder) gMenuHolder->hideMenus();
// if CTRL-tabbing (and not just TAB with no focus), go into window cycle mode
gFloaterView->setCycleMode((mask & MASK_CONTROL) != 0);
// do CTRL-TAB and CTRL-SHIFT-TAB logic
if (mask & MASK_SHIFT)
{
mRootView->focusPrevRoot();
}
else
{
mRootView->focusNextRoot();
}
return TRUE;
}
}
// give menus a chance to handle keys
if ((gMenuBarView && gMenuBarView->handleAcceleratorKey(key, mask))