summaryrefslogtreecommitdiff
path: root/indra/newview/llvoiceclient.cpp
diff options
context:
space:
mode:
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);
}