aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorThierry Crozat2012-12-02 14:41:03 +0000
committerThierry Crozat2012-12-02 14:41:17 +0000
commit674c625209a8a3e684ae238a3af676110f6e5254 (patch)
tree7d1415b4a48e2e6bb1c1c409587164d955740ef1 /engines
parent1ad6cc2376b475943466fe35458dd04848fa6ad6 (diff)
downloadscummvm-rg350-674c625209a8a3e684ae238a3af676110f6e5254.tar.gz
scummvm-rg350-674c625209a8a3e684ae238a3af676110f6e5254.tar.bz2
scummvm-rg350-674c625209a8a3e684ae238a3af676110f6e5254.zip
DREAMWEB: Fix key handling for non-QWERTY layouts
This fixes bug #3590814. The case for KP0-KP9 can probably be removed as it should be handled by the case above. But I don't have a keyboard with keypad to test. So I am leaving it for now.
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreamweb.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index f7b291b983..c3ede46df2 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -332,11 +332,12 @@ void DreamWebEngine::processEvents() {
softKey = 0;
debug(1, "DreamWebEngine::processEvents() KeyDown keycode:%d ascii:0x%02x", event.kbd.keycode, event.kbd.ascii);
- if (event.kbd.keycode >= Common::KEYCODE_a && event.kbd.keycode <= Common::KEYCODE_z) {
+ if ((event.kbd.ascii >= 'a' && event.kbd.ascii <= 'z') ||
+ (event.kbd.ascii >= 'A' && event.kbd.ascii <= 'Z')) {
softKey = event.kbd.ascii & ~0x20; // (& ~0x20) forces ascii codes for a-z to map to A-Z
- } else if (event.kbd.keycode == Common::KEYCODE_MINUS ||
- event.kbd.keycode == Common::KEYCODE_SPACE ||
- (event.kbd.keycode >= Common::KEYCODE_0 && event.kbd.keycode <= Common::KEYCODE_9)) {
+ } else if (event.kbd.ascii == '-' ||
+ event.kbd.ascii == ' ' ||
+ (event.kbd.ascii >= '0' && event.kbd.ascii <= '9')) {
softKey = event.kbd.ascii;
} else if (event.kbd.keycode >= Common::KEYCODE_KP0 && event.kbd.keycode <= Common::KEYCODE_KP9) {
softKey = event.kbd.keycode - Common::KEYCODE_KP0 + '0';