From 75ee99f4d5748e37450f2c530971da8bb59d74b5 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Tue, 22 Oct 2013 09:08:41 -0400 Subject: [PATCH] LLViewerWindow::handleKey(): More harmlessness (sync) Handle Tabbing through elements/floaters earlier. Combine g*Menu*View handleKey() checks. --- indra/newview/llviewerwindow.cpp | 52 ++++++++++++++------------------ 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 6b75e87c1..ba1335b8d 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -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))