aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/event.cpp9
-rw-r--r--engines/sherlock/tattoo/widget_files.cpp2
-rw-r--r--engines/sherlock/tattoo/widget_foolscap.cpp3
-rw-r--r--engines/sherlock/tattoo/widget_password.cpp2
4 files changed, 12 insertions, 4 deletions
diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp
index 3f615f610f..90ddaaf967 100644
--- a/engines/sci/event.cpp
+++ b/engines/sci/event.cpp
@@ -214,6 +214,15 @@ SciEvent EventManager::getScummVMEvent() {
//((ev.kbd.flags & Common::KBD_CAPS) ? SCI_KEYMOD_CAPSLOCK : 0) |
//((ev.kbd.flags & Common::KBD_SCRL) ? SCI_KEYMOD_SCRLOCK : 0) |
+ if (input.data >= Common::KEYCODE_KP0 && input.data <= Common::KEYCODE_KP9) {
+ if (!(ev.kbd.flags & Common::KBD_NUM)) {
+ // HACK: Num-Lock not enabled
+ // We shouldn't get a valid ascii code in these cases. We fix it here, so that cursor keys
+ // on the numpad work properly.
+ input.character = 0;
+ }
+ }
+
if ((input.character) && (input.character <= 0xFF)) {
// Directly accept most common keys without conversion
if ((input.character >= 0x80) && (input.character <= 0xFF)) {
diff --git a/engines/sherlock/tattoo/widget_files.cpp b/engines/sherlock/tattoo/widget_files.cpp
index ca5e1bff93..ff8cb83dca 100644
--- a/engines/sherlock/tattoo/widget_files.cpp
+++ b/engines/sherlock/tattoo/widget_files.cpp
@@ -386,7 +386,7 @@ bool WidgetFiles::getFilename() {
done = -1;
}
- if ((keyState.ascii >= ' ') && ((keyState.ascii <= 168) || (keyState.ascii == 225)) && (index < 50)) {
+ if ((keyState.ascii >= ' ') && (keyState.ascii <= 'z') && (index < 50)) {
if (pt.x + _surface.charWidth(keyState.ascii) < _surface.w() - BUTTON_SIZE - 20) {
if (insert)
filename.insertChar(keyState.ascii, index);
diff --git a/engines/sherlock/tattoo/widget_foolscap.cpp b/engines/sherlock/tattoo/widget_foolscap.cpp
index 8246e9a371..c8df71e873 100644
--- a/engines/sherlock/tattoo/widget_foolscap.cpp
+++ b/engines/sherlock/tattoo/widget_foolscap.cpp
@@ -184,8 +184,7 @@ void WidgetFoolscap::handleKeyboardEvents() {
TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
Common::KeyState keyState = ui._keyState;
- if (((toupper(keyState.ascii) >= 'A') && (toupper(keyState.ascii) <= 'Z')) ||
- ((keyState.ascii >= 128) && ((keyState.ascii <= 168) || (keyState.ascii == 225)))) {
+ if ((toupper(keyState.ascii) >= 'A') && (toupper(keyState.ascii) <= 'Z')) {
// Visible key pressed, set it and set the keycode to move the caret to the right
_answers[_lineNum][_charNum] = keyState.ascii;
keyState.keycode = Common::KEYCODE_RIGHT;
diff --git a/engines/sherlock/tattoo/widget_password.cpp b/engines/sherlock/tattoo/widget_password.cpp
index 3dd0e308ff..57a5e02653 100644
--- a/engines/sherlock/tattoo/widget_password.cpp
+++ b/engines/sherlock/tattoo/widget_password.cpp
@@ -159,7 +159,7 @@ void WidgetPassword::handleEvents() {
} else if (keycode == Common::KEYCODE_RETURN || keycode == Common::KEYCODE_ESCAPE) {
close();
return;
- } else if (((ui._keyState.ascii >= ' ' && ui._keyState.ascii < 169) || ui._keyState.ascii == 225)) {
+ } else if ((ui._keyState.ascii >= ' ') && (ui._keyState.ascii <= 'z')) {
if (_cursorPos.x + _surface.charWidth(ui._keyState.ascii) < _bounds.width() - _surface.widestChar() - 3) {
if (_insert)
_password.insertChar(ui._keyState.ascii, _index);