summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-09-17 23:15:14 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-09-17 23:15:14 +0300
commit28e07331acf45edb380c094179cef6ea5adeb010 (patch)
treec9b96c60a64b41595ba8cfe4b203ab7985570cd2 /indra
parentb661f62a7ad4dad9806eda8f4c8f2c9d64b3efbb (diff)
SL-15594 Ignore voice keys when keybinding is waiting for a key
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llsetkeybinddialog.h2
-rw-r--r--indra/newview/llviewerinput.cpp21
2 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llsetkeybinddialog.h b/indra/newview/llsetkeybinddialog.h
index a34b952233..24dfa1dbfd 100644
--- a/indra/newview/llsetkeybinddialog.h
+++ b/indra/newview/llsetkeybinddialog.h
@@ -76,6 +76,8 @@ public:
static void onDefault(void* user_data);
static void onClickTimeout(void* user_data, MASK mask);
+ static bool isRecording() { return sRecordKeys; }
+
class Updater;
private:
diff --git a/indra/newview/llviewerinput.cpp b/indra/newview/llviewerinput.cpp
index 6629a2ffac..94ec534732 100644
--- a/indra/newview/llviewerinput.cpp
+++ b/indra/newview/llviewerinput.cpp
@@ -38,6 +38,7 @@
#include "llkeybind.h" // LLKeyData
#include "llmorphview.h"
#include "llmoveview.h"
+#include "llsetkeybinddialog.h"
#include "lltoolfocus.h"
#include "lltoolpie.h"
#include "llviewercontrol.h"
@@ -1052,18 +1053,38 @@ BOOL LLViewerInput::handleKeyUp(KEY translated_key, MASK translated_mask)
bool LLViewerInput::handleGlobalBindsKeyDown(KEY key, MASK mask)
{
+ if (LLSetKeyBindDialog::isRecording())
+ {
+ // handleGlobalBindsKeyDown happens before view handling, so can't
+ // be interupted by LLSetKeyBindDialog, check manually
+ return false;
+ }
S32 mode = getMode();
return scanKey(mGlobalKeyBindings[mode], mGlobalKeyBindings[mode].size(), key, mask, TRUE, FALSE, FALSE, FALSE);
}
bool LLViewerInput::handleGlobalBindsKeyUp(KEY key, MASK mask)
{
+ if (LLSetKeyBindDialog::isRecording())
+ {
+ // handleGlobalBindsKeyUp happens before view handling, so can't
+ // be interupted by LLSetKeyBindDialog, check manually
+ return false;
+ }
+
S32 mode = getMode();
return scanKey(mGlobalKeyBindings[mode], mGlobalKeyBindings[mode].size(), key, mask, FALSE, TRUE, FALSE, FALSE);
}
bool LLViewerInput::handleGlobalBindsMouse(EMouseClickType clicktype, MASK mask, bool down)
{
+ if (LLSetKeyBindDialog::isRecording())
+ {
+ // handleGlobalBindsMouse happens before view handling, so can't
+ // be interupted by LLSetKeyBindDialog, check manually
+ return false;
+ }
+
bool res = false;
S32 mode = getMode();
if (down)