From b0ae4bf1a38b8957b8810d710a2a90f8c2039e6d Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 21 Apr 2007 21:47:14 +0000 Subject: [PATCH] Patch #1704914: "Fix for #1671426: MH2 : Doesn't recognize Enter for actions" svn-id: r26562 --- engines/agi/agi.h | 3 ++- engines/agi/detection.cpp | 18 +++++++++--------- engines/agi/keyboard.cpp | 5 +++++ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/engines/agi/agi.h b/engines/agi/agi.h index bb36b568a9c..a42f712c120 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -110,7 +110,8 @@ enum AgiGameFeatures { GF_AGIPAL = (1 << 4), GF_MACGOLDRUSH = (1 << 5), GF_FANMADE = (1 << 6), - GF_ESC_MENU = (1 << 7) + GF_ESC_MENU = (1 << 7), + GF_MANHUNTER = (1 << 8) }; struct AGIGameDescription; diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 46f7fb54721..608abf9b14a 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -897,7 +897,7 @@ static const AGIGameDescription gameDescriptions[] = { Common::ADGF_NO_FLAGS }, GType_V3, - 0, + GF_MANHUNTER, 0x3149, }, @@ -913,7 +913,7 @@ static const AGIGameDescription gameDescriptions[] = { Common::ADGF_NO_FLAGS }, GType_V3, - 0, + GF_MANHUNTER, 0x3149, }, @@ -929,7 +929,7 @@ static const AGIGameDescription gameDescriptions[] = { Common::ADGF_NO_FLAGS }, GType_V3, - 0, + GF_MANHUNTER, 0x3149, }, @@ -946,7 +946,7 @@ static const AGIGameDescription gameDescriptions[] = { Common::ADGF_NO_FLAGS }, GType_V3, - 0, + GF_MANHUNTER, 0x3149, }, @@ -962,7 +962,7 @@ static const AGIGameDescription gameDescriptions[] = { Common::ADGF_NO_FLAGS }, GType_V3, - 0, + GF_MANHUNTER, 0x3149, }, @@ -978,7 +978,7 @@ static const AGIGameDescription gameDescriptions[] = { Common::ADGF_NO_FLAGS }, GType_V3, - 0, + GF_MANHUNTER, 0x3149, }, @@ -994,7 +994,7 @@ static const AGIGameDescription gameDescriptions[] = { Common::ADGF_NO_FLAGS }, GType_V3, - 0, + GF_MANHUNTER, 0x3086, }, @@ -1010,7 +1010,7 @@ static const AGIGameDescription gameDescriptions[] = { Common::ADGF_NO_FLAGS }, GType_V3, - 0, + GF_MANHUNTER, 0x3149, }, @@ -1026,7 +1026,7 @@ static const AGIGameDescription gameDescriptions[] = { Common::ADGF_NO_FLAGS }, GType_V3, - 0, + GF_MANHUNTER, 0x3149, }, diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp index 5c5b936b696..27453848ec0 100644 --- a/engines/agi/keyboard.cpp +++ b/engines/agi/keyboard.cpp @@ -92,6 +92,11 @@ int AgiEngine::doPollKeyboard() { /* If a key is ready, rip it */ if (_gfx->keypress()) { key = _gfx->getKey(); + + if ((getFeatures() & GF_MANHUNTER) && (key == KEY_ENTER) && + (_game.inputMode == INPUT_NONE)) + key = 0x20; // Set Enter key to Space in Manhunter when there's no text input + debugC(3, kDebugLevelInput, "key %02x pressed", key); }