From 335ba979a2e3aab9c1856bf84a18b60ab91de687 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Sat, 30 Jun 2012 20:47:29 +0100 Subject: LURE: Fix engine crash in copy protection screen with AZERTY keyboard Fixes bug #3539031 - "LURE: Crash at Copy Protection Screen". This reverts the previous fix which only worked for QWERTY keyboards and made the issue worse for AZERTY keyboards. It now uses the ASCII code instead of the keycode for the sanity check. --- engines/lure/surface.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp index 7af9d665de..0f13d87fbc 100644 --- a/engines/lure/surface.cpp +++ b/engines/lure/surface.cpp @@ -1349,7 +1349,7 @@ bool CopyProtectionDialog::show() { while (!engine.shouldQuit()) { while (events.pollEvent() && (_charIndex < 4)) { - if (events.type() == Common::EVENT_KEYDOWN && !(events.event().kbd.flags & Common::KBD_NON_STICKY)) { + if (events.type() == Common::EVENT_KEYDOWN) { if ((events.event().kbd.keycode == Common::KEYCODE_BACKSPACE) && (_charIndex > 0)) { // Remove the last number typed --_charIndex; @@ -1360,8 +1360,8 @@ bool CopyProtectionDialog::show() { (*tmpHotspot)->copyTo(&screen.screen()); screen.update(); - } else if ((events.event().kbd.keycode >= Common::KEYCODE_0) && - (events.event().kbd.keycode <= Common::KEYCODE_9)) { + } else if ((events.event().kbd.ascii >= '0') && + (events.event().kbd.ascii <= '9')) { HotspotsList::iterator tmpHotspot = _hotspots.begin(); for (int i = 0; i < _charIndex + 3; i++) ++tmpHotspot; -- cgit v1.2.3