diff options
| author | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-10-03 22:45:29 +0300 | 
|---|---|---|
| committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-10-03 22:45:29 +0300 | 
| commit | 6aab234105d6eed022afbea388ae21530c7e99dd (patch) | |
| tree | ba193253fe1902967e1fff56321b512a9c5b7f20 /indra/llcommon | |
| parent | b8c5ae8d8fcf9219112c4ab48233615732737e44 (diff) | |
SL-6109 Remade 'ignore' list processing, renamed and reformed keybindings
Diffstat (limited to 'indra/llcommon')
| -rw-r--r-- | indra/llcommon/llkeybind.cpp | 9 | ||||
| -rw-r--r-- | indra/llcommon/llkeybind.h | 3 | 
2 files changed, 5 insertions, 7 deletions
| diff --git a/indra/llcommon/llkeybind.cpp b/indra/llcommon/llkeybind.cpp index ff88a9c9aa..46a3230240 100644 --- a/indra/llcommon/llkeybind.cpp +++ b/indra/llcommon/llkeybind.cpp @@ -92,14 +92,11 @@ LLSD LLKeyData::asLLSD() const      LLSD data;      data["mouse"] = (LLSD::Integer)mMouse;      data["key"] = (LLSD::Integer)mKey; +    data["mask"] = (LLSD::Integer)mMask;      if (mIgnoreMasks)      {          data["ignore_accelerators"] = (LLSD::Boolean)mIgnoreMasks;      } -    else -    { -        data["mask"] = (LLSD::Integer)mMask; -    }      return data;  } @@ -147,7 +144,7 @@ bool LLKeyData::canHandle(const LLKeyData& data) const  {      if (data.mKey == mKey          && data.mMouse == mMouse -        && (mIgnoreMasks || data.mMask == mMask)) +        && ((mIgnoreMasks && (data.mMask & mMask) == data.mMask) || data.mMask == mMask))      {          return true;      } @@ -158,7 +155,7 @@ bool LLKeyData::canHandle(EMouseClickType mouse, KEY key, MASK mask) const  {      if (mouse == mMouse          && key == mKey -        && (mIgnoreMasks || mask == mMask)) +        && ((mIgnoreMasks && (mask & mMask) == mask) || mask == mMask))      {          return true;      } diff --git a/indra/llcommon/llkeybind.h b/indra/llcommon/llkeybind.h index 39cb668aac..ad0ebec67c 100644 --- a/indra/llcommon/llkeybind.h +++ b/indra/llcommon/llkeybind.h @@ -53,7 +53,8 @@ public:      EMouseClickType mMouse;      KEY mKey;      MASK mMask; -    bool mIgnoreMasks; +    // Either to expect exact match or ignore not expected masks +    bool mIgnoreMasks;   };  // One function can bind to multiple Key options | 
