diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 80a7382153..6083d24768 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -16,7 +16,8 @@ - Feature: [objects#205] Add additional glass roofs. - Feature: [objects#209] Add the Steel Roller Coaster train and 2-across Inverted Train from RollerCoaster Tycoon 1. - Improved: [#15358] Park and scenario names can now contain up to 128 characters. -- Improved: [#16819] Don't prompt to 'Save game as' when saving a loaded saved game (excepting autosaves). +- Improved: [#15589] Numpad Enter can now be used to close text input. +- Improved: [#16819] Don't prompt to “Save game as” when saving a loaded saved game (excepting autosaves). - Improved: [#16840] Add support for rectangular heightmaps. - Improved: [#17575] You can now search for Authors in Object Selection. - Improved: [#17806] Added warning when using RCT1 objects without RCT1 linked. diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index e7b8f71c5a..abc1052ce3 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -7,6 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include #include #include #include @@ -408,13 +409,13 @@ void WindowTextInputOpen( WindowTextInputRawOpen(call_w, call_widget, title, description, descriptionArgs, existingText.c_str(), maxLength); } -void WindowTextInputKey(rct_window* w, char keychar) +void WindowTextInputKey(rct_window* w, uint32_t keycode) { const auto wndNumber = w->number; const auto wndClass = w->classification; // If the return button is pressed stop text input - if (keychar == '\r') + if (keycode == SDLK_RETURN || keycode == SDLK_KP_ENTER) { if (w->classification == WindowClass::Textinput) { diff --git a/src/openrct2-ui/windows/Window.h b/src/openrct2-ui/windows/Window.h index dac9514ee4..3582537dd4 100644 --- a/src/openrct2-ui/windows/Window.h +++ b/src/openrct2-ui/windows/Window.h @@ -149,7 +149,7 @@ rct_window* WindowNetworkStatusOpen(const char* text, close_callback onClose); rct_window* WindowNetworkStatusOpenPassword(); void WindowNetworkStatusClose(); -void WindowTextInputKey(rct_window* w, char keychar); +void WindowTextInputKey(rct_window* w, uint32_t keycode); void WindowTextInputOpen( rct_window* call_w, WidgetIndex call_widget, StringId title, StringId description, const Formatter& descriptionArgs, StringId existing_text, uintptr_t existing_args, int32_t maxLength);