[Scummvm-git-logs] scummvm master -> fa00855a109e6ba11aad663c2d41d8a503f7d31d

dreammaster dreammaster at scummvm.org
Sat Apr 7 04:31:55 CEST 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
fa00855a10 XEEN: Don't set a _buttonValue when Ctrl or Alt is pressed


Commit: fa00855a109e6ba11aad663c2d41d8a503f7d31d
    https://github.com/scummvm/scummvm/commit/fa00855a109e6ba11aad663c2d41d8a503f7d31d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-04-06T22:30:29-04:00

Commit Message:
XEEN: Don't set a _buttonValue when Ctrl or Alt is pressed

This avoids a problem where holding down Ctrl for the GMM
was passing multiple turns.. very noticeable if there were
monsters nearby, or the party is standing on a trap tile

Changed paths:
    engines/xeen/dialogs/dialogs.cpp


diff --git a/engines/xeen/dialogs/dialogs.cpp b/engines/xeen/dialogs/dialogs.cpp
index 3e777ba..f404996 100644
--- a/engines/xeen/dialogs/dialogs.cpp
+++ b/engines/xeen/dialogs/dialogs.cpp
@@ -99,15 +99,18 @@ bool ButtonContainer::checkEvents(XeenEngine *vm) {
 		Common::KeyState keyState;
 		events.getKey(keyState);
 
-		_buttonValue = keyState.keycode;
-		if (_buttonValue == Common::KEYCODE_KP8)
+		if (keyState.keycode == Common::KEYCODE_KP8)
 			_buttonValue = Common::KEYCODE_UP;
-		else if (_buttonValue == Common::KEYCODE_KP2)
+		else if (keyState.keycode == Common::KEYCODE_KP2)
 			_buttonValue = Common::KEYCODE_DOWN;
-		else if (_buttonValue == Common::KEYCODE_KP_ENTER)
+		else if (keyState.keycode == Common::KEYCODE_KP_ENTER)
 			_buttonValue = Common::KEYCODE_RETURN;
+		else if (keyState.keycode != Common::KEYCODE_LCTRL && keyState.keycode != Common::KEYCODE_RCTRL
+				&& keyState.keycode != Common::KEYCODE_LALT && keyState.keycode != Common::KEYCODE_RALT)
+			_buttonValue = keyState.keycode;
 
-		_buttonValue |= (keyState.flags & ~Common::KBD_STICKY) << 16;
+		if (_buttonValue)
+			_buttonValue |= (keyState.flags & ~Common::KBD_STICKY) << 16;
 	}
 
 	if (_buttonValue) {





More information about the Scummvm-git-logs mailing list