diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/about.cpp | 4 | ||||
-rw-r--r-- | gui/console.cpp | 11 | ||||
-rw-r--r-- | gui/launcher.cpp | 4 | ||||
-rw-r--r-- | gui/newgui.cpp | 30 |
4 files changed, 25 insertions, 24 deletions
diff --git a/gui/about.cpp b/gui/about.cpp index 9491859769..1014eefd39 100644 --- a/gui/about.cpp +++ b/gui/about.cpp @@ -270,10 +270,10 @@ void AboutDialog::handleTickle() { int modifiers = g_system->getEventManager()->getModifierState(); // Scroll faster when shift is pressed - if (modifiers & OSystem::KBD_SHIFT) + if (modifiers & Common::KBD_SHIFT) scrollOffset *= 4; // Reverse scrolling when alt is pressed - if (modifiers & OSystem::KBD_ALT) + if (modifiers & Common::KBD_ALT) scrollOffset *= -1; _scrollPos += scrollOffset; _scrollTime = t; diff --git a/gui/console.cpp b/gui/console.cpp index e990fac2af..494721e242 100644 --- a/gui/console.cpp +++ b/gui/console.cpp @@ -27,6 +27,7 @@ #include "engines/engine.h" #include "base/version.h" +#include "common/events.h" #include "common/system.h" #include "graphics/font.h" @@ -347,7 +348,7 @@ void ConsoleDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) { drawLine(pos2line(_currentPos)); break; case 256 + 24: // pageup - if (modifiers == OSystem::KBD_SHIFT) { + if (modifiers == Common::KBD_SHIFT) { _scrollLine -= _linesPerPage - 1; if (_scrollLine < _firstLineInBuffer + _linesPerPage - 1) _scrollLine = _firstLineInBuffer + _linesPerPage - 1; @@ -356,7 +357,7 @@ void ConsoleDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) { } break; case 256 + 25: // pagedown - if (modifiers == OSystem::KBD_SHIFT) { + if (modifiers == Common::KBD_SHIFT) { _scrollLine += _linesPerPage - 1; if (_scrollLine > _promptEndPos / kCharsPerLine) { _scrollLine = _promptEndPos / kCharsPerLine; @@ -368,7 +369,7 @@ void ConsoleDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) { } break; case 256 + 22: // home - if (modifiers == OSystem::KBD_SHIFT) { + if (modifiers == Common::KBD_SHIFT) { _scrollLine = _firstLineInBuffer + _linesPerPage - 1; updateScrollBuffer(); } else { @@ -377,7 +378,7 @@ void ConsoleDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) { draw(); break; case 256 + 23: // end - if (modifiers == OSystem::KBD_SHIFT) { + if (modifiers == Common::KBD_SHIFT) { _scrollLine = _promptEndPos / kCharsPerLine; if (_scrollLine < _linesPerPage - 1) _scrollLine = _linesPerPage - 1; @@ -406,7 +407,7 @@ void ConsoleDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) { default: if (ascii == '~' || ascii == '#') { slideUpAndClose(); - } else if (modifiers == OSystem::KBD_CTRL) { + } else if (modifiers == Common::KBD_CTRL) { specialKeys(keycode); } else if ((ascii >= 32 && ascii <= 127) || (ascii >= 160 && ascii <= 255)) { for (i = _promptEndPos - 1; i >= _currentPos; i--) diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 7ea863c512..8ba3f0f538 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -620,7 +620,7 @@ void LauncherDialog::updateListing() { void LauncherDialog::addGame() { int modifiers = g_system->getEventManager()->getModifierState(); - bool massAdd = (modifiers & OSystem::KBD_SHIFT) != 0; + bool massAdd = (modifiers & Common::KBD_SHIFT) != 0; if (massAdd) { MessageDialog alert("Do you really want to run the mass game detector? " @@ -866,7 +866,7 @@ void LauncherDialog::updateButtons() { // Update the label of the "Add" button depending on whether shift is pressed or not int modifiers = g_system->getEventManager()->getModifierState(); - const char *newAddButtonLabel = ((modifiers & OSystem::KBD_SHIFT) != 0) + const char *newAddButtonLabel = ((modifiers & Common::KBD_SHIFT) != 0) ? "Mass Add..." : "Add Game..."; diff --git a/gui/newgui.cpp b/gui/newgui.cpp index adb27b83df..6d153a6b77 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -242,11 +242,11 @@ void NewGui::runLoop() { _theme->drawAll(); _system->updateScreen(); - OSystem::Event event; + Common::Event event; uint32 time = _system->getMillis(); while (eventMan->pollEvent(event)) { - if (activeDialog != getTopDialog() && event.type != OSystem::EVENT_QUIT && event.type != OSystem::EVENT_SCREEN_CHANGED) + if (activeDialog != getTopDialog() && event.type != Common::EVENT_QUIT && event.type != Common::EVENT_SCREEN_CHANGED) continue; Common::Point mouse(event.mouse.x - activeDialog->_x, event.mouse.y - activeDialog->_y); @@ -266,19 +266,19 @@ void NewGui::runLoop() { } switch (event.type) { - case OSystem::EVENT_KEYDOWN: + case Common::EVENT_KEYDOWN: activeDialog->handleKeyDown(event.kbd.ascii, event.kbd.keycode, event.kbd.flags); break; - case OSystem::EVENT_KEYUP: + case Common::EVENT_KEYUP: activeDialog->handleKeyUp(event.kbd.ascii, event.kbd.keycode, event.kbd.flags); break; - case OSystem::EVENT_MOUSEMOVE: + case Common::EVENT_MOUSEMOVE: activeDialog->handleMouseMoved(mouse.x, mouse.y, 0); break; // 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); + case Common::EVENT_LBUTTONDOWN: + case Common::EVENT_RBUTTONDOWN: + button = (event.type == Common::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) { @@ -291,21 +291,21 @@ void NewGui::runLoop() { _lastClick.time = time; activeDialog->handleMouseDown(mouse.x, mouse.y, button, _lastClick.count); break; - case OSystem::EVENT_LBUTTONUP: - case OSystem::EVENT_RBUTTONUP: - button = (event.type == OSystem::EVENT_LBUTTONUP ? 1 : 2); + case Common::EVENT_LBUTTONUP: + case Common::EVENT_RBUTTONUP: + button = (event.type == Common::EVENT_LBUTTONUP ? 1 : 2); activeDialog->handleMouseUp(mouse.x, mouse.y, button, _lastClick.count); break; - case OSystem::EVENT_WHEELUP: + case Common::EVENT_WHEELUP: activeDialog->handleMouseWheel(mouse.x, mouse.y, -1); break; - case OSystem::EVENT_WHEELDOWN: + case Common::EVENT_WHEELDOWN: activeDialog->handleMouseWheel(mouse.x, mouse.y, 1); break; - case OSystem::EVENT_QUIT: + case Common::EVENT_QUIT: _system->quit(); return; - case OSystem::EVENT_SCREEN_CHANGED: + case Common::EVENT_SCREEN_CHANGED: screenChange(); break; } |