From 21f98fff46e48e79d3e977d4f20edf90022a825a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 1 May 2016 09:46:25 -0400 Subject: TITANIC: Fix cursor and entering text in PET Conversations area --- engines/titanic/pet_control/pet_conversations.cpp | 15 +++++---------- engines/titanic/pet_control/pet_text.cpp | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) (limited to 'engines/titanic/pet_control') diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp index d4298dada1..eb2f9716b6 100644 --- a/engines/titanic/pet_control/pet_conversations.cpp +++ b/engines/titanic/pet_control/pet_conversations.cpp @@ -465,17 +465,12 @@ bool CPetConversations::handleKey(const Common::KeyState &keyState) { case Common::KEYCODE_KP1: scrollToBottom(); break; - case Common::KEYCODE_BACKSPACE: - // Erase key in text input - _textInput.handleKey((char)Common::KEYCODE_BACKSPACE); - case Common::KEYCODE_RETURN: - case Common::KEYCODE_KP_ENTER: - // Text line finished - textLineEntered(_textInput.getText()); - return true; default: - if (keyState.ascii >= 32 && keyState.ascii) - _textInput.handleKey(keyState.ascii); + if (keyState.ascii > 0 && keyState.ascii) { + if (_textInput.handleKey(keyState.ascii)) + // Text line finished, so process line + textLineEntered(_textInput.getText()); + } return true; } diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp index 1065e6f825..1d2740249f 100644 --- a/engines/titanic/pet_control/pet_text.cpp +++ b/engines/titanic/pet_control/pet_text.cpp @@ -192,7 +192,7 @@ void CPetText::resize(uint count) { CString CPetText::getText() const { CString result = ""; - for (int idx = 0; idx < _lineCount; ++idx) + for (int idx = 0; idx <= _lineCount; ++idx) result += _array[idx]._line; return result; -- cgit v1.2.3