Browse Source

Updated Mouse Wheel values on Linux

seanpaultaylor 12 years ago
parent
commit
e729be4438
1 changed files with 9 additions and 5 deletions
  1. 9 5
      gameplay/src/PlatformLinux.cpp

+ 9 - 5
gameplay/src/PlatformLinux.cpp

@@ -1240,9 +1240,14 @@ int Platform::enterMessagePump()
                                 break;
                             case 4:
                             case 5:
-                                gameplay::Platform::mouseEventInternal(gameplay::Mouse::MOUSE_WHEEL,
-                                        evt.xbutton.x, evt.xbutton.y,
-                                        evt.xbutton.button == Button4 ? 1 : -1);
+				int wheelDelta;
+				if (evt.xbutton.button == Button4)
+				    wheelDelta = 1;
+                                else if (evt.xbutton.button == Button5)
+                                    wheelDelta = -1;
+				else
+				    wheelDelta = 0;
+                                gameplay::Platform::mouseEventInternal(gameplay::Mouse::MOUSE_WHEEL, evt.xbutton.x, evt.xbutton.y, wheelDelta);
                                 break;
                             default:
                                 break;
@@ -1287,8 +1292,7 @@ int Platform::enterMessagePump()
                         {
                             if (x == __mouseCapturePointX && y == __mouseCapturePointY)
                             {
-                                // Discard the first MotionNotify following capture
-                                // since it contains bogus x,y data.
+                                // Discard the first MotionNotify following capture since it contains bogus x,y data.
                                 break;
                             }