NANCY: Use numpad enter key

In places where the engine expects text input, using the
numpad enter key now acts the same as using the return key
This commit is contained in:
Kaloyan Chehlarski 2023-11-28 11:29:31 +02:00
parent 882691dd50
commit 2bd6092738
3 changed files with 3 additions and 3 deletions

View File

@ -211,7 +211,7 @@ void PasswordPuzzle::handleInput(NancyInput &input) {
drawText();
}
} else if (key.keycode == Common::KEYCODE_RETURN) {
} else if (key.keycode == Common::KEYCODE_RETURN || key.keycode == Common::KEYCODE_KP_ENTER) {
_playerHasHitReturn = true;
} else if (Common::isAlnum(key.ascii) || Common::isSpace(key.ascii)) {
if (activeField.size() && activeField.lastChar() == '-') {

View File

@ -289,7 +289,7 @@ void RiddlePuzzle::handleInput(NancyInput &input) {
drawText();
}
} else if (key.keycode == Common::KEYCODE_RETURN) {
} else if (key.keycode == Common::KEYCODE_RETURN || key.keycode == Common::KEYCODE_KP_ENTER) {
if (_playerInput.size() == 0 ||
(_playerInput.size() == 1 && _playerInput.lastChar() == '-')) {
continue;

View File

@ -419,7 +419,7 @@ void LoadSaveMenu::enterFilename() {
if (_enteredString.size()) {
_enteredString.deleteLastChar();
}
} else if (key.keycode == Common::KEYCODE_RETURN) {
} else if (key.keycode == Common::KEYCODE_RETURN || key.keycode == Common::KEYCODE_KP_ENTER) {
enterKeyPressed = true;
} else if (Common::isAlnum(key.ascii) || Common::isSpace(key.ascii)) {
_enteredString += key.ascii;