mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-11 19:54:03 +00:00
WINTERMUTE: Use ascii for detecting printable-characters instead of Keycode.
This commit is contained in:
parent
8e2e317294
commit
aebdeb183f
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user