From a0bf70b41d84c50da081917f0ec842cca973f45b Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 18 Jul 2019 19:18:02 +0300 Subject: SL-11592 [Mac] Ability to bind extra mouse buttons for push to talk --- indra/llwindow/llwindowmacosx.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'indra/llwindow/llwindowmacosx.cpp') 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) -- cgit v1.2.3 From c5bcb31d00cdac597ce6e406c253ba456e9436c8 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Fri, 19 Jul 2019 13:40:17 +0300 Subject: SL-11592 [Mac] Fixed mouse buttons ids for correct handling. --- indra/llwindow/llwindowmacosx.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/llwindow/llwindowmacosx.cpp') diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 6749b3be3b..d9b95d311a 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -426,13 +426,14 @@ void callOtherMouseDown(float *pos, MASK mask, int button) gWindowImplementation->getMouseDeltas(deltas); outCoords.mX += deltas[0]; outCoords.mY += deltas[1]; - if (button == 3) + + if (button == 2) { gWindowImplementation->getCallbacks()->handleMiddleMouseDown(gWindowImplementation, outCoords, mask); } else { - gWindowImplementation->getCallbacks()->handleOtherMouseDown(gWindowImplementation, outCoords, mask, button); + gWindowImplementation->getCallbacks()->handleOtherMouseDown(gWindowImplementation, outCoords, mask, button + 1); } } @@ -445,13 +446,13 @@ void callOtherMouseUp(float *pos, MASK mask, int button) gWindowImplementation->getMouseDeltas(deltas); outCoords.mX += deltas[0]; outCoords.mY += deltas[1]; - if (button == 3) + if (button == 2) { gWindowImplementation->getCallbacks()->handleMiddleMouseUp(gWindowImplementation, outCoords, mask); } else { - gWindowImplementation->getCallbacks()->handleOtherMouseUp(gWindowImplementation, outCoords, mask, button); + gWindowImplementation->getCallbacks()->handleOtherMouseUp(gWindowImplementation, outCoords, mask, button + 1); } } -- cgit v1.2.3 From 153c2b2446cee584cec034405921bdd9bfdc7c70 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 11 Sep 2019 16:49:10 +0300 Subject: SL-11918 [Mac] Wheel support (horizontal scroll) --- indra/llwindow/llwindowmacosx.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/llwindow/llwindowmacosx.cpp') diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index d9b95d311a..2604a23c85 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -356,9 +356,13 @@ void callMouseDragged(float *pos, MASK mask) gWindowImplementation->getCallbacks()->handleMouseDragged(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE)); } -void callScrollMoved(float delta) +void callScrollMoved(float deltaX, float deltaY) { - gWindowImplementation->getCallbacks()->handleScrollWheel(gWindowImplementation, delta); + if ( gWindowImplementation && gWindowImplementation->getCallbacks() ) + { + gWindowImplementation->getCallbacks()->handleScrollHWheel(gWindowImplementation, deltaX); + gWindowImplementation->getCallbacks()->handleScrollWheel(gWindowImplementation, deltaY); + } } void callMouseExit() -- cgit v1.2.3