summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llmenugl.cpp21
-rw-r--r--indra/llui/llmenugl.h2
2 files changed, 23 insertions, 0 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index e6a3de281e..986f3362b7 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -3514,6 +3514,27 @@ S32 LLMenuBarGL::getRightmostMenuEdge()
return (*item_iter)->getRect().mRight;
}
+bool LLMenuBarGL::hasAccelerator(const KEY &key, const MASK &mask) const
+{
+ if (key == KEY_NONE)
+ {
+ return false;
+ }
+
+ LLMenuKeyboardBinding *accelerator = NULL;
+ std::list<LLMenuKeyboardBinding*>::const_iterator list_it;
+ for (list_it = mAccelerators.begin(); list_it != mAccelerators.end(); ++list_it)
+ {
+ accelerator = *list_it;
+ if ((accelerator->mKey == key) && (accelerator->mMask == (mask & MASK_NORMALKEYS)))
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
// add a vertical separator to this menu
BOOL LLMenuBarGL::addSeparator()
{
diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h
index 3a6b849e73..0653864892 100644
--- a/indra/llui/llmenugl.h
+++ b/indra/llui/llmenugl.h
@@ -792,6 +792,8 @@ public:
void resetMenuTrigger() { mAltKeyTrigger = FALSE; }
+ bool hasAccelerator(const KEY &key, const MASK &mask) const;
+
private:
// add a menu - this will create a drop down menu.
virtual BOOL appendMenu( LLMenuGL* menu );