[Scummvm-cvs-logs] scummvm master -> aebdeb183f280723ccd1ae9d9cdd13df45067792

somaen einarjohan at somadalen.com
Thu Dec 13 20:13:10 CET 2012


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:
aebdeb183f WINTERMUTE: Use ascii for detecting printable-characters instead of Keycode.


Commit: aebdeb183f280723ccd1ae9d9cdd13df45067792
    https://github.com/scummvm/scummvm/commit/aebdeb183f280723ccd1ae9d9cdd13df45067792
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2012-12-13T11:12:08-08:00

Commit Message:
WINTERMUTE: Use ascii for detecting printable-characters instead of Keycode.

Changed paths:
    engines/wintermute/base/base_keyboard_state.cpp



diff --git a/engines/wintermute/base/base_keyboard_state.cpp b/engines/wintermute/base/base_keyboard_state.cpp
index e12583b..3123183 100644
--- a/engines/wintermute/base/base_keyboard_state.cpp
+++ b/engines/wintermute/base/base_keyboard_state.cpp
@@ -200,9 +200,7 @@ const char *BaseKeyboardState::scToString() {
 bool BaseKeyboardState::readKey(Common::Event *event) {
 	//_currentPrintable = (event->type == SDL_TEXTINPUT); // TODO
 	_currentCharCode = keyCodeToVKey(event);
-	if ((_currentCharCode <= Common::KEYCODE_z && _currentCharCode >= Common::KEYCODE_a) ||
-	        (_currentCharCode <= Common::KEYCODE_9 && _currentCharCode >= Common::KEYCODE_0) ||
-			(_currentCharCode == Common::KEYCODE_SPACE)) {
+	if ((_currentCharCode <= 0x7E && _currentCharCode >= 0x20) || (_currentCharCode <= 0xFF && _currentCharCode >= 0x1F)) {
 		_currentPrintable = true;
 	} else {
 		_currentPrintable = false;
@@ -272,7 +270,7 @@ uint32 BaseKeyboardState::keyCodeToVKey(Common::Event *event) {
 	case Common::KEYCODE_KP_ENTER:
 		return Common::KEYCODE_RETURN;
 	default:
-		return (uint32)event->kbd.keycode;
+		return (uint32)event->kbd.ascii;
 	}
 }
 






More information about the Scummvm-git-logs mailing list