From ac45c5b33d834acbc9718f89be76e49d403a4d2c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 26 May 2007 18:12:12 +0000 Subject: Fix bug #1709430: "FT: CAPSLOCK + V enables cheating for all fights" svn-id: r26948 --- engines/scumm/input.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index 54feafb115..d31d3afd85 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -145,8 +145,18 @@ void ScummEngine::parseEvents() { // possible to a bug in sdl-common.cpp if (event.kbd.ascii >= 512) debugC(DEBUG_GENERAL, "keyPressed > 512 (%d)", event.kbd.ascii); - else + else { _keyDownMap[event.kbd.ascii] = false; + + // Due to some weird bug with capslock key pressed + // generated keydown event is for lower letter but + // keyup is for upper letter + // On most (all?) keyboards it is safe to assume that + // both upper and lower letters are unpressed on keyup event + // + // Fixes bug #1709430: "FT: CAPSLOCK + V enables cheating for all fights" + _keyDownMap[toupper(event.kbd.ascii)] = false; + } break; -- cgit v1.2.3