summaryrefslogtreecommitdiff
path: root/indra/newview/llvoiceclient.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2019-12-16 13:02:08 +0000
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2019-12-16 13:02:08 +0000
commit14fdd7c4908083e7e09c97d4ddc19eb1cb92de39 (patch)
treebe4d09e4503583ebb402bd394e9fee21baef6c79 /indra/newview/llvoiceclient.cpp
parentd0abb6e1e091e89186df1d1fe6c8256f0bac497c (diff)
parentd656d49a77eeb65ae537c954ea4009bc22da7b2b (diff)
merge
Diffstat (limited to 'indra/newview/llvoiceclient.cpp')
-rw-r--r--indra/newview/llvoiceclient.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index d8c8cb0461..cc590fc947 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -125,7 +125,7 @@ LLVoiceClient::LLVoiceClient(LLPumpIO *pump)
mPTTDirty(true),
mPTT(true),
mUsePTT(true),
- mPTTIsMiddleMouse(false),
+ mPTTMouseButton(0),
mPTTKey(0),
mPTTIsToggle(false),
mUserPTTState(false),
@@ -639,13 +639,22 @@ bool LLVoiceClient::getPTTIsToggle()
void LLVoiceClient::setPTTKey(std::string &key)
{
+ // Value is stored as text for readability
if(key == "MiddleMouse")
{
- mPTTIsMiddleMouse = true;
+ mPTTMouseButton = LLMouseHandler::CLICK_MIDDLE;
+ }
+ else if(key == "MouseButton4")
+ {
+ mPTTMouseButton = LLMouseHandler::CLICK_BUTTON4;
+ }
+ else if (key == "MouseButton5")
+ {
+ mPTTMouseButton = LLMouseHandler::CLICK_BUTTON5;
}
else
{
- mPTTIsMiddleMouse = false;
+ mPTTMouseButton = 0;
if(!LLKeyboard::keyFromString(key, &mPTTKey))
{
// If the call failed, don't match any key.
@@ -682,7 +691,7 @@ void LLVoiceClient::keyDown(KEY key, MASK mask)
return;
}
- if (!mPTTIsMiddleMouse && LLAgent::isActionAllowed("speak") && (key == mPTTKey))
+ if (mPTTMouseButton == 0 && LLAgent::isActionAllowed("speak") && (key == mPTTKey))
{
bool down = gKeyboard->getKeyDown(mPTTKey);
if (down)
@@ -694,7 +703,7 @@ void LLVoiceClient::keyDown(KEY key, MASK mask)
}
void LLVoiceClient::keyUp(KEY key, MASK mask)
{
- if (!mPTTIsMiddleMouse && (key == mPTTKey))
+ if (mPTTMouseButton == 0 && (key == mPTTKey))
{
bool down = gKeyboard->getKeyDown(mPTTKey);
if (!down)
@@ -703,9 +712,9 @@ void LLVoiceClient::keyUp(KEY key, MASK mask)
}
}
}
-void LLVoiceClient::middleMouseState(bool down)
+void LLVoiceClient::updateMouseState(S32 click, bool down)
{
- if(mPTTIsMiddleMouse && LLAgent::isActionAllowed("speak"))
+ if(mPTTMouseButton == click && LLAgent::isActionAllowed("speak"))
{
inputUserControlState(down);
}