Added logic to NOT trigger camera mousemove if keyboard has a key pressed so you can scroll with keys and still move mouse simultaneously

This commit is contained in:
Mark Vejvoda
2010-03-27 21:32:33 +00:00
parent 02b1cb40e2
commit cda368b96c
5 changed files with 41 additions and 25 deletions

View File

@@ -111,6 +111,7 @@ private:
static unsigned int lastMouseEvent; /** for use in mouse hover calculations */
static MouseState mouseState;
static Vec2i mousePos;
static bool isKeyPressedDown;
static void setLastMouseEvent(unsigned int lastMouseEvent) {Window::lastMouseEvent = lastMouseEvent;}
static unsigned int getLastMouseEvent() {return Window::lastMouseEvent;}
@@ -127,6 +128,7 @@ protected:
public:
static bool handleEvent();
static void revertMousePos();
static bool isKeyDown() { return isKeyPressedDown; }
Window();

View File

@@ -110,7 +110,8 @@ private:
static unsigned int lastMouseEvent; /** for use in mouse hover calculations */
static MouseState mouseState;
static Vec2i mousePos;
static Vec2i mousePos;
static bool isKeyPressedDown;
static void setLastMouseEvent(unsigned int lastMouseEvent) {Window::lastMouseEvent = lastMouseEvent;}
static unsigned int getLastMouseEvent() {return Window::lastMouseEvent;}
@@ -119,7 +120,7 @@ private:
static void setMouseState(MouseButton b, bool state) {Window::mouseState.set(b, state);}
static const Vec2i &getMousePos() {return Window::mousePos;}
static void setMousePos(const Vec2i &mousePos) {Window::mousePos = mousePos;}
static void setMousePos(const Vec2i &mousePos) {Window::mousePos = mousePos;}
protected:
WindowHandle handle;
@@ -137,6 +138,7 @@ protected:
public:
static bool handleEvent();
static void revertMousePos();
static bool isKeyDown() { return isKeyPressedDown; }
//contructor & destructor
Window();