diff options
author | Einar Johan Trøan Sømåen | 2012-12-13 20:12:08 +0100 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-12-13 20:12:08 +0100 |
commit | aebdeb183f280723ccd1ae9d9cdd13df45067792 (patch) | |
tree | 27f75e356c99620101ba4f69f5fbd99d840f711d /engines/wintermute/base | |
parent | 8e2e3172941ae2f79f2ccdb321b7ff539bcca41e (diff) | |
download | scummvm-rg350-aebdeb183f280723ccd1ae9d9cdd13df45067792.tar.gz scummvm-rg350-aebdeb183f280723ccd1ae9d9cdd13df45067792.tar.bz2 scummvm-rg350-aebdeb183f280723ccd1ae9d9cdd13df45067792.zip |
WINTERMUTE: Use ascii for detecting printable-characters instead of Keycode.
Diffstat (limited to 'engines/wintermute/base')
-rw-r--r-- | engines/wintermute/base/base_keyboard_state.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/engines/wintermute/base/base_keyboard_state.cpp b/engines/wintermute/base/base_keyboard_state.cpp index e12583b5a4..3123183d00 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; } } |