[Bf-committers] Mouse wheel for X11
Martin Vollrathson
bf-committers@blender.org
Tue, 28 Jan 2003 03:27:07 +0100
This is a multi-part message in MIME format.
--------------030201000202010301010002
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
I made a small patch for
/blender/intern/ghost/intern/GHOST_SystemX11.cpp to get mouse wheel
support under X11. It seems to work.
/Martin Vollrathson
--------------030201000202010301010002
Content-Type: text/plain;
name="GHOST_SystemX11.cpp.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="GHOST_SystemX11.cpp.diff"
--- GHOST_SystemX11.cpp 2002-12-19 21:08:12.000000000 +0100
+++ /home/mavos/GHOST_SystemX11.cpp 2003-01-28 02:57:27.000000000 +0100
@@ -71,6 +71,7 @@
#include "GHOST_EventCursor.h"
#include "GHOST_EventKey.h"
#include "GHOST_EventButton.h"
+#include "GHOST_EventWheel.h"
#include "GHOST_DisplayManagerX11.h"
#include "GHOST_Debug.h"
@@ -380,7 +381,22 @@
break;
}
+
case ButtonPress:
+ {
+ if (xe->xbutton.button == 4 || xe->xbutton.button == 5) {
+ switch (xe->xbutton.button) {
+ case 4:
+ g_event = new GHOST_EventWheel(getMilliSeconds(), window, 3);
+ break;
+ case 5:
+ g_event = new GHOST_EventWheel(getMilliSeconds(), window, -3);
+ break;
+ }
+
+ break;
+ }
+ }
case ButtonRelease:
{
--------------030201000202010301010002--