diff options
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rwxr-xr-x | indra/newview/llviewerwindow.cpp | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b6212e0958..6be63ef889 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1381,7 +1381,11 @@ BOOL LLViewerWindow::handleTranslatedKeyDown(KEY key, MASK mask, BOOL repeated) // it's all entered/processed. if (key == KEY_RETURN && mask == MASK_NONE) { - return FALSE; + // RIDER: although, at times some of the controlls (in particular the CEF viewer + // would like to know about the KEYDOWN for an enter key... so ask and pass it along. + LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus(); + if (keyboard_focus && !keyboard_focus->wantsReturnKey()) + return FALSE; } return gViewerKeyboard.handleKey(key, mask, repeated); @@ -2543,22 +2547,27 @@ void LLViewerWindow::draw() //#endif } -// Takes a single keydown event, usually when UI is visible +// Takes a single keyup event, usually when UI is visible BOOL LLViewerWindow::handleKeyUp(KEY key, MASK mask) { - if (gFocusMgr.getKeyboardFocus() + LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus(); + + if (keyboard_focus && !(mask & (MASK_CONTROL | MASK_ALT)) && !gFocusMgr.getKeystrokesOnly()) { // We have keyboard focus, and it's not an accelerator - if (key < 0x80) + if (keyboard_focus && keyboard_focus->wantsKeyUpKeyDown()) + { + return keyboard_focus->handleKey(key, mask, FALSE); + } + else if (key < 0x80) { // Not a special key, so likely (we hope) to generate a character. Let it fall through to character handler first. return (gFocusMgr.getKeyboardFocus() != NULL); } } - LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus(); if (keyboard_focus) { if (keyboard_focus->handleKeyUp(key, mask, FALSE)) @@ -2584,15 +2593,21 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) // hide tooltips on keypress LLToolTipMgr::instance().blockToolTips(); - if (gFocusMgr.getKeyboardFocus() + LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus(); + + if (keyboard_focus && !(mask & (MASK_CONTROL | MASK_ALT)) && !gFocusMgr.getKeystrokesOnly()) { // We have keyboard focus, and it's not an accelerator - if (key < 0x80) + if (keyboard_focus && keyboard_focus->wantsKeyUpKeyDown()) + { + return keyboard_focus->handleKey(key, mask, FALSE ); + } + else if (key < 0x80) { // Not a special key, so likely (we hope) to generate a character. Let it fall through to character handler first. - return (gFocusMgr.getKeyboardFocus() != NULL); + return (keyboard_focus != NULL); } } @@ -2606,7 +2621,6 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) return TRUE; } - LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus(); // give menus a chance to handle modified (Ctrl, Alt) shortcut keys before current focus // as long as focus isn't locked @@ -2632,7 +2646,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) // 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 (key == KEY_TAB && (mask & MASK_CONTROL || keyboard_focus == NULL)) { LL_WARNS() << "LLviewerWindow::handleKey give floaters first chance at tab key " << LL_ENDL; if (gMenuHolder) gMenuHolder->hideMenus(); |