diff options
author | Max Horn | 2005-01-06 22:51:25 +0000 |
---|---|---|
committer | Max Horn | 2005-01-06 22:51:25 +0000 |
commit | fa3d618fae78501272a62c02fd754a4cbecb84d3 (patch) | |
tree | 45c33fbc22438197d7d1508d2b8b614fe5ee81b0 /gui/newgui.cpp | |
parent | 858c6c4d5bb40a29550009b07f8d4b583d3f03cb (diff) | |
download | scummvm-rg350-fa3d618fae78501272a62c02fd754a4cbecb84d3.tar.gz scummvm-rg350-fa3d618fae78501272a62c02fd754a4cbecb84d3.tar.bz2 scummvm-rg350-fa3d618fae78501272a62c02fd754a4cbecb84d3.zip |
Distinguish left and right mouse button
svn-id: r16468
Diffstat (limited to 'gui/newgui.cpp')
-rw-r--r-- | gui/newgui.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gui/newgui.cpp b/gui/newgui.cpp index 98014faf24..ea624fbc98 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -96,6 +96,7 @@ void NewGui::updateScaleFactor() { void NewGui::runLoop() { Dialog *activeDialog = _dialogStack.top(); bool didSaveState = false; + int button; if (activeDialog == 0) return; @@ -155,6 +156,7 @@ void NewGui::runLoop() { // We don't distinguish between mousebuttons (for now at least) case OSystem::EVENT_LBUTTONDOWN: case OSystem::EVENT_RBUTTONDOWN: + button = (event.type == OSystem::EVENT_LBUTTONDOWN ? 1 : 2); if (_lastClick.count && (time < _lastClick.time + kDoubleClickDelay) && ABS(_lastClick.x - event.mouse.x) < 3 && ABS(_lastClick.y - event.mouse.y) < 3) { @@ -165,11 +167,12 @@ void NewGui::runLoop() { _lastClick.count = 1; } _lastClick.time = time; - activeDialog->handleMouseDown(event.mouse.x - (activeDialog->_x * _scaleFactor), event.mouse.y - (activeDialog->_y * _scaleFactor), 1, _lastClick.count); + activeDialog->handleMouseDown(event.mouse.x - (activeDialog->_x * _scaleFactor), event.mouse.y - (activeDialog->_y * _scaleFactor), button, _lastClick.count); break; case OSystem::EVENT_LBUTTONUP: case OSystem::EVENT_RBUTTONUP: - activeDialog->handleMouseUp(event.mouse.x - (activeDialog->_x * _scaleFactor), event.mouse.y - (activeDialog->_y * _scaleFactor), 1, _lastClick.count); + button = (event.type == OSystem::EVENT_LBUTTONUP ? 1 : 2); + activeDialog->handleMouseUp(event.mouse.x - (activeDialog->_x * _scaleFactor), event.mouse.y - (activeDialog->_y * _scaleFactor), button, _lastClick.count); break; case OSystem::EVENT_WHEELUP: activeDialog->handleMouseWheel(event.mouse.x - (activeDialog->_x * _scaleFactor), event.mouse.y - (activeDialog->_y * _scaleFactor), -1); |