From b75f6182b0596e885e4fe70719b818d9cb32694e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 29 Jan 2016 23:02:28 -0500 Subject: SHERLOCK: RT: Simplify ascii char checks, since we don't support accents --- engines/sherlock/tattoo/widget_files.cpp | 2 +- engines/sherlock/tattoo/widget_foolscap.cpp | 3 +-- engines/sherlock/tattoo/widget_password.cpp | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'engines/sherlock') 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); -- cgit v1.2.3