Mousewheel under X11 (patch by Martin Vollrathson)
[blender.git] / intern / ghost / intern / GHOST_SystemX11.cpp
index 651fd2268293190a122e719655c4af47b4474c04..f6645125575041fdd49c83dd8aaeb7a105291dfe 100755 (executable)
@@ -71,6 +71,7 @@
 #include "GHOST_EventCursor.h"
 #include "GHOST_EventKey.h"
 #include "GHOST_EventButton.h"
 #include "GHOST_EventCursor.h"
 #include "GHOST_EventKey.h"
 #include "GHOST_EventButton.h"
+#include "GHOST_EventWheel.h"
 #include "GHOST_DisplayManagerX11.h"
 
 #include "GHOST_Debug.h"
 #include "GHOST_DisplayManagerX11.h"
 
 #include "GHOST_Debug.h"
@@ -380,7 +381,19 @@ processEvent(
                        
                break;
                }
                        
                break;
                }
+
                case ButtonPress:
                case ButtonPress:
+               {
+                       /* process wheel mouse events and break */
+                       if (xe->xbutton.button == 4) {
+                               g_event = new GHOST_EventWheel(getMilliSeconds(), window, 1);
+                               break;
+                       }
+                       if (xe->xbutton.button == 5) {
+                               g_event = new GHOST_EventWheel(getMilliSeconds(), window, -1);
+                               break;
+                       }
+               }
                case ButtonRelease:
                {
 
                case ButtonRelease:
                {