From ee3fe6f66a008c583d02c3d63dd39fcd527a65f4 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 12 Aug 2022 17:08:09 +0300 Subject: SL-17964 FIXED Pressing M while any floater has focus switches into mouselook --- indra/newview/llviewerwindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ebbc9c0681..ae9da97642 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -262,6 +262,8 @@ static const F32 MIN_UI_SCALE = 0.75f; static const F32 MAX_UI_SCALE = 7.0f; static const F32 MIN_DISPLAY_SCALE = 0.75f; +static const char KEY_MOUSELOOK = 'M'; + static LLCachedControl sSnapshotBaseName(LLCachedControl(gSavedPerAccountSettings, "SnapshotBaseName", "Snapshot")); static LLCachedControl sSnapshotDir(LLCachedControl(gSavedPerAccountSettings, "SnapshotBaseDir", "")); @@ -2879,6 +2881,13 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) if (keyboard_focus && !gFocusMgr.getKeystrokesOnly()) { + //Most things should fall through, but mouselook is an exception, + //don't switch to mouselook if any floater has focus + if ((key == KEY_MOUSELOOK) && !(mask & (MASK_CONTROL | MASK_ALT))) + { + return TRUE; + } + LLUICtrl* cur_focus = dynamic_cast(keyboard_focus); if (cur_focus && cur_focus->acceptsTextInput()) { -- cgit v1.2.3