1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-03 18:07:53 +01:00

Fix #9684 and #9690: Enter and keypad enter are treated as different keys

* Remapped keypad Enter to return scancode

Fix #9684: Entering custom size for water/land tool allows confirmation
with main enter key, but not numpad enter key

Fix #9690: The keyboard shortcut for rotating the game view can be set
to Enter or KP Enter, but not both

* Add changelog entry
This commit is contained in:
Denis Khabenkov
2019-10-18 11:40:07 +03:00
committed by Michael Steenbeek
parent 1f3998909b
commit 6632b979d7
2 changed files with 5 additions and 1 deletions

View File

@@ -106,13 +106,15 @@ void TextComposition::HandleMessage(const SDL_Event* e)
uint16_t modifier = e->key.keysym.mod;
SDL_Keycode key = e->key.keysym.sym;
SDL_Scancode scancode = e->key.keysym.scancode;
if (key == SDLK_KP_ENTER)
{
// Map Keypad enter to regular enter.
key = SDLK_RETURN;
scancode = SDL_SCANCODE_RETURN;
}
GetContext()->GetUiContext()->SetKeysPressed(key, e->key.keysym.scancode);
GetContext()->GetUiContext()->SetKeysPressed(key, scancode);
// Text input
if (_session.Buffer == nullptr)