diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-12-04 21:25:34 +0200 | 
|---|---|---|
| committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-12-04 21:26:16 +0200 | 
| commit | c713b953e831172bf161d011dc7eda600eb5b139 (patch) | |
| tree | a574145c1a5959fcea9ab2edd028eced26ca5f96 | |
| parent | 4de5f6a8533174696211fab8952adc7001357ba4 (diff) | |
SL-14438 Adjusted behavior of recording mask keys
If 'mask+key' got rejected, don record it as 'mask'
| -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 | 
