aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/keyboard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/agi/keyboard.cpp')
-rw-r--r--engines/agi/keyboard.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp
index d899a6e202..a7f15c16fb 100644
--- a/engines/agi/keyboard.cpp
+++ b/engines/agi/keyboard.cpp
@@ -114,7 +114,7 @@ int AgiEngine::handleController(int key) {
debugC(3, kDebugLevelInput, "key = %04x", key);
- for (i = 0; i < _game.lastController; i++) {
+ for (i = 0; i < MAX_CONTROLLERS; i++) {
if (_game.controllers[i].keycode == key) {
debugC(3, kDebugLevelInput, "event %d: key press", _game.controllers[i].controller);
_game.controllerOccured[_game.controllers[i].controller] = true;
@@ -180,10 +180,17 @@ int AgiEngine::handleController(int key) {
if (!(getFeatures() & GF_AGIMOUSE)) {
// Handle mouse button events
if (key == BUTTON_LEFT) {
- v->flags |= fAdjEgoXY;
- v->parm1 = WIN_TO_PIC_X(_mouse.x);
- v->parm2 = WIN_TO_PIC_Y(_mouse.y);
- return true;
+ if (getGameID() == GID_PQ1 && _game.vars[vCurRoom] == 116) {
+ // WORKAROUND: Special handling for mouse clicks in the newspaper
+ // screen of PQ1. Fixes bug #3018770.
+ d = 3; // fake a right arrow key (next page)
+ } else {
+ // Click-to-walk mouse interface
+ v->flags |= fAdjEgoXY;
+ v->parm1 = WIN_TO_PIC_X(_mouse.x);
+ v->parm2 = WIN_TO_PIC_Y(_mouse.y);
+ return true;
+ }
}
}