From 59b56552665fe23b3c3daf236e94e391c20f757d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 29 Dec 2007 09:50:20 +0000 Subject: Added access property for middle mouse button svn-id: r30069 --- engines/lure/events.cpp | 12 +++++++++++- engines/lure/events.h | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/engines/lure/events.cpp b/engines/lure/events.cpp index 52916df0cc..d3b1235ec9 100644 --- a/engines/lure/events.cpp +++ b/engines/lure/events.cpp @@ -44,6 +44,7 @@ Mouse::Mouse() { _lButton = false; _rButton = false; + _mButton = false; _cursorNum = CURSOR_ARROW; _x = 0; _y = 0; @@ -70,6 +71,12 @@ void Mouse::handleEvent(Common::Event event) { case Common::EVENT_RBUTTONUP: _rButton = false; break; + case Common::EVENT_MBUTTONDOWN: + _mButton = true; + break; + case Common::EVENT_MBUTTONUP: + _mButton = false; + break; default: break; } @@ -134,7 +141,7 @@ void Mouse::waitForRelease() { do { while (e.pollEvent() && !e.quitFlag) ; g_system->delayMillis(20); - } while (!e.quitFlag && (lButton() || rButton())); + } while (!e.quitFlag && (lButton() || rButton() || mButton())); } /*--------------------------------------------------------------------------*/ @@ -164,6 +171,8 @@ bool Events::pollEvent() { case Common::EVENT_LBUTTONUP: case Common::EVENT_RBUTTONDOWN: case Common::EVENT_RBUTTONUP: + case Common::EVENT_MBUTTONDOWN: + case Common::EVENT_MBUTTONUP: case Common::EVENT_MOUSEMOVE: case Common::EVENT_WHEELUP: case Common::EVENT_WHEELDOWN: @@ -184,6 +193,7 @@ void Events::waitForPress() { if (_event.type == Common::EVENT_QUIT) return; else if (_event.type == Common::EVENT_KEYDOWN) keyButton = true; else if ((_event.type == Common::EVENT_LBUTTONDOWN) || + (_event.type == Common::EVENT_MBUTTONDOWN) || (_event.type == Common::EVENT_RBUTTONDOWN)) { keyButton = true; Mouse::getReference().waitForRelease(); diff --git a/engines/lure/events.h b/engines/lure/events.h index fa054da949..cd0e5f21d9 100644 --- a/engines/lure/events.h +++ b/engines/lure/events.h @@ -38,7 +38,7 @@ class Mouse { private: CursorType _cursorNum; int16 _x, _y; - bool _lButton, _rButton; + bool _lButton, _rButton, _mButton; public: Mouse(); ~Mouse(); @@ -55,6 +55,7 @@ public: int16 y() { return _y; } bool lButton() { return _lButton; } bool rButton() { return _rButton; } + bool mButton() { return _mButton; } void waitForRelease(); void pushCursorNum(CursorType cursorNum); void pushCursorNum(CursorType cursorNum, int hotspotX, int hotspotY); -- cgit v1.2.3