AVALANCHE: Add Parser::handleBackspace(). Update Avalot::handleKeyDown() accordingly.
This commit is contained in:
parent
df427ba7e8
commit
825df596e6
3 changed files with 17 additions and 0 deletions
|
@ -171,6 +171,8 @@ void Avalot::handleKeyDown(const Common::Event &event) {
|
|||
case Common::KEYCODE_KP5:
|
||||
_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
|
||||
break;
|
||||
case Common::KEYCODE_BACKSPACE :
|
||||
_vm->_parser->handleBackspace();
|
||||
}
|
||||
|
||||
if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47))
|
||||
|
|
|
@ -56,6 +56,19 @@ void Parser::handleInputText(const Common::Event &event) {
|
|||
}
|
||||
}
|
||||
|
||||
void Parser::handleBackspace() {
|
||||
if (! _vm->_dropdown->ddm_o.menunow) {
|
||||
if (_inputTextPos > _leftMargin) {
|
||||
_inputTextPos--;
|
||||
if ((_inputText[_inputTextPos] == '"') || (_inputText[_inputTextPos] == '`'))
|
||||
_quote = !_quote;
|
||||
_inputText.deleteChar(_inputTextPos);
|
||||
plotText();
|
||||
} else
|
||||
_vm->_gyro->blip();
|
||||
}
|
||||
}
|
||||
|
||||
void Parser::plotText() {
|
||||
if (_vm->_gyro->mouse_near_text())
|
||||
_vm->_gyro->super_off();
|
||||
|
|
|
@ -46,6 +46,8 @@ public:
|
|||
|
||||
void handleInputText(const Common::Event &event);
|
||||
|
||||
void handleBackspace();
|
||||
|
||||
void plotText();
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue