SL-17964 FIXED Pressing M while any floater has focus switches into mouselook

meow-7.2.2
Mnikolenko Productengine 2022-08-12 17:08:09 +03:00 committed by Ansariel
parent 2b2fdb6cb5
commit df46b5723d
1 changed files with 9 additions and 0 deletions

View File

@ -293,6 +293,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<std::string> sSnapshotBaseName(LLCachedControl<std::string>(gSavedPerAccountSettings, "SnapshotBaseName", "Snapshot"));
static LLCachedControl<std::string> sSnapshotDir(LLCachedControl<std::string>(gSavedPerAccountSettings, "SnapshotBaseDir", ""));
@ -3296,6 +3298,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<LLUICtrl*>(keyboard_focus);
if (cur_focus && cur_focus->acceptsTextInput())
{