summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowmacosx.cpp
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-07-18 19:18:02 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-07-18 19:18:02 +0300
commita0bf70b41d84c50da081917f0ec842cca973f45b (patch)
tree575f309eda23c32bcfcfee9182e4248b543d779c /indra/llwindow/llwindowmacosx.cpp
parentba2429163af92b510d26444bb33f9f9d941c6dda (diff)
SL-11592 [Mac] Ability to bind extra mouse buttons for push to talk
Diffstat (limited to 'indra/llwindow/llwindowmacosx.cpp')
-rw-r--r--indra/llwindow/llwindowmacosx.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 3554f90be8..6749b3be3b 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -417,7 +417,7 @@ void callDeltaUpdate(float *delta, MASK mask)
gWindowImplementation->updateMouseDeltas(delta);
}
-void callMiddleMouseDown(float *pos, MASK mask)
+void callOtherMouseDown(float *pos, MASK mask, int button)
{
LLCoordGL outCoords;
outCoords.mX = ll_round(pos[0]);
@@ -426,10 +426,17 @@ void callMiddleMouseDown(float *pos, MASK mask)
gWindowImplementation->getMouseDeltas(deltas);
outCoords.mX += deltas[0];
outCoords.mY += deltas[1];
- gWindowImplementation->getCallbacks()->handleMiddleMouseDown(gWindowImplementation, outCoords, mask);
+ if (button == 3)
+ {
+ gWindowImplementation->getCallbacks()->handleMiddleMouseDown(gWindowImplementation, outCoords, mask);
+ }
+ else
+ {
+ gWindowImplementation->getCallbacks()->handleOtherMouseDown(gWindowImplementation, outCoords, mask, button);
+ }
}
-void callMiddleMouseUp(float *pos, MASK mask)
+void callOtherMouseUp(float *pos, MASK mask, int button)
{
LLCoordGL outCoords;
outCoords.mX = ll_round(pos[0]);
@@ -437,8 +444,15 @@ void callMiddleMouseUp(float *pos, MASK mask)
float deltas[2];
gWindowImplementation->getMouseDeltas(deltas);
outCoords.mX += deltas[0];
- outCoords.mY += deltas[1];
- gWindowImplementation->getCallbacks()->handleMiddleMouseUp(gWindowImplementation, outCoords, mask);
+ outCoords.mY += deltas[1];
+ if (button == 3)
+ {
+ gWindowImplementation->getCallbacks()->handleMiddleMouseUp(gWindowImplementation, outCoords, mask);
+ }
+ else
+ {
+ gWindowImplementation->getCallbacks()->handleOtherMouseUp(gWindowImplementation, outCoords, mask, button);
+ }
}
void callModifier(MASK mask)