|
From: <cn...@us...> - 2010-04-05 06:12:42
|
Revision: 688
http://hgengine.svn.sourceforge.net/hgengine/?rev=688&view=rev
Author: cnlohr
Date: 2010-04-05 06:12:33 +0000 (Mon, 05 Apr 2010)
Log Message:
-----------
Tweak to allow detection of actual mouse-motion commands, as to prevent confusing the rest of the system.
Modified Paths:
--------------
Mercury2/modules/Cu2.cpp
Mercury2/src/MercuryInput.cpp
Mercury2/src/MercuryInput.h
Mercury2/src/X11Window.cpp
Modified: Mercury2/modules/Cu2.cpp
===================================================================
--- Mercury2/modules/Cu2.cpp 2010-03-29 18:38:45 UTC (rev 687)
+++ Mercury2/modules/Cu2.cpp 2010-04-05 06:12:33 UTC (rev 688)
@@ -59,7 +59,7 @@
m_bWasMouseInThisFrame = bIsInside;
- for( unsigned button = 0; button < 8; button++ )
+ for( unsigned button = 0; button < 3; button++ )
{
unsigned char Mask = 1<<button;
bool bWasDown = iLastButtonMask & Mask;
Modified: Mercury2/src/MercuryInput.cpp
===================================================================
--- Mercury2/src/MercuryInput.cpp 2010-03-29 18:38:45 UTC (rev 687)
+++ Mercury2/src/MercuryInput.cpp 2010-04-05 06:12:33 UTC (rev 688)
@@ -11,7 +11,7 @@
buttons.data = 0;
}
-void MouseInput::ProcessMouseInput(int dx, int dy, bool leftButton, bool rightButton, bool centerButton, bool scrollUpButton, bool scrollDownButton)
+void MouseInput::ProcessMouseInput(int dx, int dy, bool leftButton, bool rightButton, bool centerButton, bool scrollUpButton, bool scrollDownButton, bool bMotionEvent )
{
MouseInput* mi = new MouseInput();
mi->dx = dx;
@@ -23,6 +23,7 @@
buttons.scrollup = scrollUpButton;
buttons.scrolldown = scrollDownButton;
mi->buttons = buttons;
+ mi->buttons.motion = bMotionEvent;
currentButtonMasks = buttons;
GlobalMouseX_Set.Set( dx );
Modified: Mercury2/src/MercuryInput.h
===================================================================
--- Mercury2/src/MercuryInput.h 2010-03-29 18:38:45 UTC (rev 687)
+++ Mercury2/src/MercuryInput.h 2010-04-05 06:12:33 UTC (rev 688)
@@ -19,14 +19,15 @@
unsigned int center: 1;
unsigned int scrollup: 1;
unsigned int scrolldown: 1;
+ unsigned int motion : 1; //if 1, don't expect other button info, it's a mouse-motion event.
};
} buttonMask;
- static void ProcessMouseInput(int dx, int dy, bool leftButton, bool rightButton, bool centerButton, bool scrollUpButton, bool scrollDownButton);
+ static void ProcessMouseInput(int dx, int dy, bool leftButton, bool rightButton, bool centerButton, bool scrollUpButton, bool scrollDownButton, bool motionevent);
MouseInput();
int32_t dx, dy;
buttonMask buttons;
-
+
private:
static buttonMask currentButtonMasks;
};
Modified: Mercury2/src/X11Window.cpp
===================================================================
--- Mercury2/src/X11Window.cpp 2010-03-29 18:38:45 UTC (rev 687)
+++ Mercury2/src/X11Window.cpp 2010-04-05 06:12:33 UTC (rev 688)
@@ -289,7 +289,7 @@
sd = ((e->state & X11_MASK(MOUSE_BTN_SCROLL_DOWN))!=0) ^ (e->button == MOUSE_BTN_SCROLL_DOWN);
MouseInput::ProcessMouseInput(m_iLastMouseX, m_iLastMouseY ,
- left, right, center, su, sd);
+ left, right, center, su, sd, false);
break;
}
case KeyPress:
@@ -327,7 +327,7 @@
{
m_iLastMouseX = x;
m_iLastMouseY = y;
- MouseInput::ProcessMouseInput(x, y, left, right, center, su, sd);
+ MouseInput::ProcessMouseInput(x, y, left, right, center, su, sd, true);
XWarpPointer(m_display, None, m_window, 0,0,0,0,m_width/2,m_height/2);
}
}
@@ -335,7 +335,7 @@
{
m_iLastMouseX = e->x;
m_iLastMouseY = e->y;
- MouseInput::ProcessMouseInput(e->x, e->y, left, right, center, su, sd);
+ MouseInput::ProcessMouseInput(e->x, e->y, left, right, center, su, sd, true);
}
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|