summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorKelly Washington <kelly@lindenlab.com>2010-09-24 15:57:17 -0700
committerKelly Washington <kelly@lindenlab.com>2010-09-24 15:57:17 -0700
commitd129d6ee23995d0a5e89aa71e56d6ed6aa95761e (patch)
tree0f8ff06e67af5cf7e3c031432c6ed1f25717866f /indra/newview
parent22228896ee2ce6f20d67ce2c4a415fcd40d6b6e0 (diff)
VWR-21377 Script editor ctrl-f fix.
let some LLViews handle shortcut keys if they want. reviewed with ambroff
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpreviewscript.h2
-rw-r--r--indra/newview/llviewerwindow.cpp11
2 files changed, 12 insertions, 1 deletions
diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h
index ef4f0d9c20..3207da4e00 100644
--- a/indra/newview/llpreviewscript.h
+++ b/indra/newview/llpreviewscript.h
@@ -87,6 +87,8 @@ public:
static void onBtnInsertSample(void*);
static void onBtnInsertFunction(LLUICtrl*, void*);
+ virtual bool hasMenus() const { return true; }
+
private:
void onBtnHelp();
void onBtnDynamicHelp();
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 0a3a8993ec..5a069547e4 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2134,10 +2134,20 @@ 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
if (mask & (MASK_CONTROL | MASK_ALT) && !gFocusMgr.focusLocked())
{
+ // Check the current floater's menu first, if it has one.
+ if (gFocusMgr.keyboardFocusHasMenus()
+ && keyboard_focus
+ && keyboard_focus->handleKey(key,mask,FALSE))
+ {
+ return TRUE;
+ }
+
if ((gMenuBarView && gMenuBarView->handleAcceleratorKey(key, mask))
||(gLoginMenuBarView && gLoginMenuBarView->handleAcceleratorKey(key, mask)))
{
@@ -2173,7 +2183,6 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
}
// Traverses up the hierarchy
- LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
if( keyboard_focus )
{
LLLineEditor* chat_editor = LLBottomTray::instanceExists() ? LLBottomTray::getInstance()->getNearbyChatBar()->getChatBox() : NULL;