diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llsetkeybinddialog.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llsetkeybinddialog.h | 1 |
2 files changed, 12 insertions, 2 deletions
diff --git a/indra/newview/llsetkeybinddialog.cpp b/indra/newview/llsetkeybinddialog.cpp index a7f005ec19..4b36822e9a 100644 --- a/indra/newview/llsetkeybinddialog.cpp +++ b/indra/newview/llsetkeybinddialog.cpp @@ -72,6 +72,7 @@ LLSetKeyBindDialog::LLSetKeyBindDialog(const LLSD& key) pParent(NULL), mKeyFilterMask(DEFAULT_KEY_FILTER), pUpdater(NULL), + mLastMaskKey(0), mContextConeOpacity(0.f), mContextConeInAlpha(0.f), mContextConeOutAlpha(0.f), @@ -211,15 +212,22 @@ bool LLSetKeyBindDialog::recordAndHandleKey(KEY key, MASK mask, BOOL down) if (key == KEY_CONTROL || key == KEY_SHIFT || key == KEY_ALT) { // Mask keys get special treatment + if ((mKeyFilterMask & ALLOW_MASKS) == 0) + { + // Masks by themself are not allowed + return false; + } if (down == TRUE) { // Most keys are handled on 'down' event because menu is handled on 'down' // masks are exceptions to let other keys be handled + mLastMaskKey = key; return false; } - if ((mKeyFilterMask & ALLOW_MASKS) == 0) + if (mLastMaskKey != key) { - // Mask by themself are not allowed + // This was mask+key combination that got rejected, don't handle mask's key + // Or user did something like: press shift, press ctrl, release shift return false; } // Mask up event often generates things like 'shift key + shift mask', filter it out. @@ -251,6 +259,7 @@ bool LLSetKeyBindDialog::recordAndHandleKey(KEY key, MASK mask, BOOL down) { pDesription->setText(getString("reserved_by_menu")); pDesription->setTextArg("[KEYSTR]", LLKeyboard::stringFromAccelerator(mask,key)); + mLastMaskKey = 0; return true; } diff --git a/indra/newview/llsetkeybinddialog.h b/indra/newview/llsetkeybinddialog.h index ec3c813a66..a34b952233 100644 --- a/indra/newview/llsetkeybinddialog.h +++ b/indra/newview/llsetkeybinddialog.h @@ -87,6 +87,7 @@ private: U32 mKeyFilterMask; Updater *pUpdater; + KEY mLastMaskKey; static bool sRecordKeys; // for convinience and not to check instance each time |