diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp
index 1f16d12adda1e5eb177439df6dd615e87fd5fb30..43e5f6b051d4f344c7e65f91a2fabc6bc67ab4dc 100644
--- a/indra/llui/llfocusmgr.cpp
+++ b/indra/llui/llfocusmgr.cpp
@@ -315,6 +315,20 @@ void LLFocusMgr::removeKeyboardFocusWithoutCallback( const LLFocusableElement* f
 	}
 }
 
+bool LLFocusMgr::keyboardFocusHasAccelerators() const
+{
+	LLView* focus_view = dynamic_cast<LLView*>(mKeyboardFocus);
+	while( focus_view )
+	{
+		if(focus_view->hasAccelerators())
+		{
+			return true;
+		}
+
+		focus_view = focus_view->getParent();
+	}
+	return false;
+}
 
 void LLFocusMgr::setMouseCapture( LLMouseHandler* new_captor )
 {
diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h
index eef82a3b5ab4bc706eebf7c3b7a5a56b21404a11..22c1895075e70b8a5e1f5ee9d94841c79b507064 100644
--- a/indra/llui/llfocusmgr.h
+++ b/indra/llui/llfocusmgr.h
@@ -118,6 +118,8 @@ class LLFocusMgr
 	void			unlockFocus();
 	BOOL			focusLocked() const { return mLockedView != NULL; }
 
+	bool			keyboardFocusHasAccelerators() const;
+
 private:
 	LLUICtrl*			mLockedView;
 
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 6bcee98f262e96dfb874188d5558fb2c3234848b..33d345beff50bb9329fa00996e1b010c9c17889e 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -273,6 +273,11 @@ class LLView : public LLMouseHandler, public LLMortician, public LLFocusableElem
 	BOOL focusNextRoot();
 	BOOL focusPrevRoot();
 
+	// Normally we want the app menus to get priority on accelerated keys
+	// However, sometimes we want to give specific views a first chance
+	// iat handling them. (eg. the script editor)
+	virtual bool	hasAccelerators() const { return false; };
+
 	// delete all children. Override this function if you need to
 	// perform any extra clean up such as cached pointers to selected
 	// children, etc.
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 627010bb53f0455f23f4d76c65450924295a3665..cf2ea3828808d0c4d53f5a1296386f1e62d12280 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -138,6 +138,9 @@ class LLFloaterScriptSearch : public LLFloater
 	LLScriptEdCore* getEditorCore() { return mEditorCore; }
 	static LLFloaterScriptSearch* getInstance() { return sInstance; }
 
+	virtual bool hasAccelerators() const;
+	virtual BOOL handleKeyHere(KEY key, MASK mask);
+
 private:
 
 	LLScriptEdCore* mEditorCore;
@@ -242,7 +245,24 @@ void LLFloaterScriptSearch::handleBtnReplaceAll()
 	mEditorCore->mEditor->replaceTextAll(getChild<LLUICtrl>("search_text")->getValue().asString(), getChild<LLUICtrl>("replace_text")->getValue().asString(), caseChk->get());
 }
 
+bool LLFloaterScriptSearch::hasAccelerators() const
+{
+	if (mEditorCore)
+	{
+		return mEditorCore->hasAccelerators();
+	}
+	return FALSE;
+}
+
+BOOL LLFloaterScriptSearch::handleKeyHere(KEY key, MASK mask)
+{
+	if (mEditorCore)
+	{
+		return mEditorCore->handleKeyHere(key, mask);
+	}
 
+	return FALSE;
+}
 
 /// ---------------------------------------------------------------------------
 /// LLScriptEdCore
diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h
index ef4f0d9c2041913270b1eaf03143233052b9f5c4..f4b31e5962f5a4b5926c661ec058f7829ad70855 100644
--- a/indra/newview/llpreviewscript.h
+++ b/indra/newview/llpreviewscript.h
@@ -87,6 +87,8 @@ class LLScriptEdCore : public LLPanel
 	static void		onBtnInsertSample(void*);
 	static void		onBtnInsertFunction(LLUICtrl*, void*);
 
+	virtual bool	hasAccelerators() const { return true; }
+
 private:
 	void		onBtnHelp();
 	void		onBtnDynamicHelp();
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index b2ff39bbd27930163e3ac8eadd39d28628037fe0..983a2d25c810b65494fc3759eec73fdbc2320232 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2136,10 +2136,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.keyboardFocusHasAccelerators()
+			&& keyboard_focus 
+			&& keyboard_focus->handleKey(key,mask,FALSE))
+		{
+			return TRUE;
+		}
+
 		if ((gMenuBarView && gMenuBarView->handleAcceleratorKey(key, mask))
 			||(gLoginMenuBarView && gLoginMenuBarView->handleAcceleratorKey(key, mask)))
 		{
@@ -2175,7 +2185,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;