diff --git a/indra/llwindow/llmousehandler.cpp b/indra/llwindow/llmousehandler.cpp
index bea66e763c21cee23b736f471aa679b935f6643c..d5fa65fe4b09a58b92ce8a37ed2be61c2f8b2de0 100644
--- a/indra/llwindow/llmousehandler.cpp
+++ b/indra/llwindow/llmousehandler.cpp
@@ -38,6 +38,10 @@ BOOL LLMouseHandler::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType cli
 		case CLICK_RIGHT: handled = handleRightMouseDown(x, y, mask); break;
 		case CLICK_MIDDLE: handled = handleMiddleMouseDown(x, y, mask); break;
 		case CLICK_DOUBLELEFT: handled = handleDoubleClick(x, y, mask); break;
+		case CLICK_BUTTON4:
+		case CLICK_BUTTON5:
+			LL_INFOS() << "Handle mouse button " << clicktype + 1 << " down." << LL_ENDL;
+			break;
 		default:
 			LL_WARNS() << "Unhandled enum." << LL_ENDL;
 		}
@@ -50,6 +54,10 @@ BOOL LLMouseHandler::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType cli
 		case CLICK_RIGHT: handled = handleRightMouseUp(x, y, mask); break;
 		case CLICK_MIDDLE: handled = handleMiddleMouseUp(x, y, mask); break;
 		case CLICK_DOUBLELEFT: handled = handleDoubleClick(x, y, mask); break;
+		case CLICK_BUTTON4:
+		case CLICK_BUTTON5:
+			LL_INFOS() << "Handle mouse button " << clicktype + 1 << " up." << LL_ENDL;
+			break;
 		default:
 			LL_WARNS() << "Unhandled enum." << LL_ENDL;
 		}
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 6749b3be3bf12dad41408234a96ebcc2d1037e17..d9b95d311aee58c378ced3d6c82f44d3bef5af42 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);
     }
 }