From 541f5f9c3b20311140d11f64f71678de2cc5c663 Mon Sep 17 00:00:00 2001 From: uruk Date: Sat, 27 Jul 2013 16:55:50 +0200 Subject: AVALANCHE: Implement Avalot::handleKeyDown() further. --- engines/avalanche/avalot.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 3f967fb868..ef0de65635 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -89,7 +89,7 @@ void Avalot::setup() { _vm->_lucerna->load_digits(); _vm->_gyro->cheat = false; _vm->_gyro->cp = 0; - _vm->_gyro->curpos = 1; + _vm->_gyro->curpos = 0; _vm->_gyro->quote = true; _vm->_gyro->ledstatus = 177; _vm->_gyro->defaultled = 2; @@ -172,6 +172,29 @@ void Avalot::handleKeyDown(const Common::Event &event) { _vm->_trip->handleMoveKey(event); // Fallthroughs are intended. break; } + + if (((32 <= event.kbd.ascii) && (event.kbd.ascii <= 46)) || ((48 <= event.kbd.ascii) && (event.kbd.ascii <= 223)) + || ((225 <= event.kbd.ascii) && (event.kbd.ascii <= 255))) { + byte inChar = event.kbd.ascii; + if (_vm->_dropdown->ddm_o.menunow) { + _vm->_dropdown->parsekey(inChar, _vm->_enhanced->extd); + } else { + if (_vm->_gyro->inputText.size() < 76) { + if ((inChar == '"') || (inChar == '`')) { + if (_vm->_gyro->quote) + inChar = '`'; + else + inChar = '"'; + _vm->_gyro->quote = !_vm->_gyro->quote; // quote - unquote + } + + _vm->_gyro->inputText.insertChar(inChar, _vm->_gyro->curpos); + _vm->_gyro->curpos++; + _vm->_basher->plottext(); + } else + _vm->_gyro->blip(); + } + } } -- cgit v1.2.3