diff options
author | Paul Gilbert | 2017-08-04 22:00:49 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-08-04 22:00:49 -0400 |
commit | e44c5bdcc6ca300d70d2455a70ee466552e52dc2 (patch) | |
tree | bdba17efbfcae4808bccc5c4b0da5c14665cc194 /engines/titanic/pet_control | |
parent | f9c370d942d28c15b44a7f1786fac3e9e3bb545f (diff) | |
download | scummvm-rg350-e44c5bdcc6ca300d70d2455a70ee466552e52dc2.tar.gz scummvm-rg350-e44c5bdcc6ca300d70d2455a70ee466552e52dc2.tar.bz2 scummvm-rg350-e44c5bdcc6ca300d70d2455a70ee466552e52dc2.zip |
TITANIC: Introduce movement via arrow keys
This also fixes a bug with Page Up, Down, Home, & End not working for
the Conversation tab. Additionally, code for scrolling individual
lines in the conversation and glyphs via the arrow keys has been
removed in favor of this centrallised movement, since they were
somewhat redundant, and the mouse wheel can be used for scrolling.
Diffstat (limited to 'engines/titanic/pet_control')
-rw-r--r-- | engines/titanic/pet_control/pet_conversations.cpp | 21 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_glyphs.cpp | 15 |
2 files changed, 7 insertions, 29 deletions
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp index 6db804ee16..0a31f44bbf 100644 --- a/engines/titanic/pet_control/pet_conversations.cpp +++ b/engines/titanic/pet_control/pet_conversations.cpp @@ -461,37 +461,30 @@ TTnpcScript *CPetConversations::getNPCScript(const CString &name) const { bool CPetConversations::handleKey(const Common::KeyState &keyState) { switch (keyState.keycode) { - case Common::KEYCODE_UP: - case Common::KEYCODE_KP8: - scrollUp(); - break; - case Common::KEYCODE_DOWN: - case Common::KEYCODE_KP2: - scrollDown(); - break; case Common::KEYCODE_PAGEUP: case Common::KEYCODE_KP9: scrollUpPage(); - break; + return true; case Common::KEYCODE_PAGEDOWN: case Common::KEYCODE_KP3: scrollDownPage(); - break; + return true; case Common::KEYCODE_HOME: case Common::KEYCODE_KP7: scrollToTop(); - break; + return true; case Common::KEYCODE_END: case Common::KEYCODE_KP1: scrollToBottom(); - break; + return true; default: - if (keyState.ascii > 0 && keyState.ascii) { + if (keyState.ascii > 0 && keyState.ascii <= 127) { if (_textInput.handleKey(keyState.ascii)) // Text line finished, so process line textLineEntered(_textInput.getText()); + return true; } - return true; + break; } return false; diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp index 0f640294fc..5ce2283f6e 100644 --- a/engines/titanic/pet_control/pet_glyphs.cpp +++ b/engines/titanic/pet_control/pet_glyphs.cpp @@ -415,21 +415,6 @@ bool CPetGlyphs::KeyCharMsg(int key) { } bool CPetGlyphs::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) { - Common::KeyCode key = msg->_keyState.keycode; - - switch (key) { - case Common::KEYCODE_LEFT: - decSelection(); - return true; - - case Common::KEYCODE_RIGHT: - incSelection(); - return true; - - default: - break; - } - if (_highlightIndex >= 0) { CPetGlyph *glyph = getGlyph(_highlightIndex); if (glyph && glyph->VirtualKeyCharMsg(msg)) |