diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-07-21 22:15:12 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-07-21 22:15:12 +0300 |
commit | 84a0ae682ab18f0366528d7d6d449ab95a1fb3f9 (patch) | |
tree | 4be4fddbef4c7ad016d316fe348aec901e9f70ef /indra/newview/llviewerinput.cpp | |
parent | b388191062aec4cc1121b69e72c0cad856509b4d (diff) |
SL-15611 Do not ignore mask modifiers for mouse-teleporting
Diffstat (limited to 'indra/newview/llviewerinput.cpp')
-rw-r--r-- | indra/newview/llviewerinput.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/indra/newview/llviewerinput.cpp b/indra/newview/llviewerinput.cpp index 77b0c8e37b..a43b49a316 100644 --- a/indra/newview/llviewerinput.cpp +++ b/indra/newview/llviewerinput.cpp @@ -1068,7 +1068,7 @@ bool LLViewerInput::handleGlobalBindsMouse(EMouseClickType clicktype, MASK mask, if (down) { S32 mode = getMode(); - res = scanMouse(mGlobalMouseBindings[mode], mGlobalMouseBindings[mode].size(), clicktype, mask, MOUSE_STATE_DOWN); + res = scanMouse(mGlobalMouseBindings[mode], mGlobalMouseBindings[mode].size(), clicktype, mask, MOUSE_STATE_DOWN, true); } return res; } @@ -1530,11 +1530,18 @@ BOOL LLViewerInput::handleMouse(LLWindow *window_impl, LLCoordGL pos, MASK mask, return handled; } -bool LLViewerInput::scanMouse(const std::vector<LLMouseBinding> &binding, S32 binding_count, EMouseClickType mouse, MASK mask, EMouseState state) const +bool LLViewerInput::scanMouse( + const std::vector<LLMouseBinding> &binding, + S32 binding_count, + EMouseClickType mouse, + MASK mask, + EMouseState state, + bool ignore_additional_masks +) const { for (S32 i = 0; i < binding_count; i++) { - if (binding[i].mMouse == mouse && (binding[i].mMask & mask) == binding[i].mMask) + if (binding[i].mMouse == mouse && (ignore_additional_masks ? (binding[i].mMask & mask) == binding[i].mMask : binding[i].mMask == mask)) { bool res = false; switch (state) @@ -1571,7 +1578,11 @@ bool LLViewerInput::scanMouse(EMouseClickType click, EMouseState state) const bool res = false; S32 mode = getMode(); MASK mask = gKeyboard->currentMask(TRUE); - res = scanMouse(mMouseBindings[mode], mMouseBindings[mode].size(), click, mask, state); + + // By default mouse clicks require exact mask + // Todo: support for mIgnoreMasks because some functions like teleports + // expect to be canceled, but for voice it's prefered to ignore mask. + res = scanMouse(mMouseBindings[mode], mMouseBindings[mode].size(), click, mask, state, false); // no user defined actions found or those actions can't handle the key/button, handle control if nessesary if (!res && agent_control_lbutton.canHandle(click, KEY_NONE, mask)) { |