diff options
| author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-09-07 20:17:26 +0300 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-09-08 21:05:06 +0300 |
| commit | c37498bb4017e89654c0687a3f84792ecb445c47 (patch) | |
| tree | ebf9228a8df5a590f0df1090b854a9b8418ac4b1 /indra/newview/llviewerinput.cpp | |
| parent | d5d5fd815f2833bdc968d35a213a12380ac0dec6 (diff) | |
#6243 Double RMB support
Diffstat (limited to 'indra/newview/llviewerinput.cpp')
| -rw-r--r-- | indra/newview/llviewerinput.cpp | 51 |
1 files changed, 44 insertions, 7 deletions
diff --git a/indra/newview/llviewerinput.cpp b/indra/newview/llviewerinput.cpp index 5741d7f5fb..ddcabd9cda 100644 --- a/indra/newview/llviewerinput.cpp +++ b/indra/newview/llviewerinput.cpp @@ -1050,6 +1050,16 @@ bool LLViewerInput::mouseFromString(const std::string& string, EMouseClickType * *mode = CLICK_DOUBLELEFT; return true; } + else if (string == "Double RMB") + { + *mode = CLICK_DOUBLERIGHT; + return true; + } + else if (string == "Double MMB") + { + *mode = CLICK_DOUBLEMIDDLE; + return true; + } else if (string == "MMB") { *mode = CLICK_MIDDLE; @@ -1624,18 +1634,44 @@ bool LLViewerInput::handleMouse(LLWindow *window_impl, LLCoordGL pos, MASK mask, // If UI doesn't handle double click, LMB click is issued, so supres LMB 'down' when doubleclick is set // handle !down as if we are handling doubleclick - bool double_click_sp = (clicktype == CLICK_LEFT - && (mMouseLevel[CLICK_DOUBLELEFT] != MOUSE_STATE_SILENT) - && mMouseLevel[CLICK_LEFT] == MOUSE_STATE_SILENT); + bool double_click_sp = false; + EMouseClickType replace_clcktype = CLICK_NONE; + switch(clicktype) + { + case CLICK_LEFT: + { + double_click_sp = (mMouseLevel[CLICK_DOUBLELEFT] != MOUSE_STATE_SILENT) + && mMouseLevel[CLICK_LEFT] == MOUSE_STATE_SILENT; + replace_clcktype = CLICK_DOUBLELEFT; + break; + } + case CLICK_RIGHT: + { + double_click_sp = (mMouseLevel[CLICK_DOUBLERIGHT] != MOUSE_STATE_SILENT) + && mMouseLevel[CLICK_RIGHT] == MOUSE_STATE_SILENT; + replace_clcktype = CLICK_DOUBLERIGHT; + break; + } + case CLICK_MIDDLE: + { + double_click_sp = (mMouseLevel[CLICK_DOUBLEMIDDLE] != MOUSE_STATE_SILENT) + && mMouseLevel[CLICK_MIDDLE] == MOUSE_STATE_SILENT; + replace_clcktype = CLICK_DOUBLEMIDDLE; + break; + } + default: + break; + } + if (double_click_sp && !down) { // Process doubleclick instead - clicktype = CLICK_DOUBLELEFT; + clicktype = replace_clcktype; } // If the first LMB click is handled by the menu, skip the following double click static bool skip_double_click = false; - if (clicktype == CLICK_LEFT && down) + if ((clicktype == CLICK_LEFT) && down) { skip_double_click = is_toolmgr_action ? false : handled; } @@ -1643,9 +1679,10 @@ bool LLViewerInput::handleMouse(LLWindow *window_impl, LLCoordGL pos, MASK mask, if (double_click_sp && down) { // Consume click. - // Due to handling, double click that is not handled will be immediately followed by LMB click + // Due to handling, double click that is not handled will be immediately followed by LMB/RMB/MMB click } - else if (clicktype == CLICK_DOUBLELEFT && skip_double_click) + else if ((clicktype == CLICK_DOUBLELEFT) + && skip_double_click) { handled = true; } |
