mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-31 10:45:16 +01:00
Part of #15589: Make numpad enter able to confirm input
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <SDL_keycode.h>
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <openrct2-ui/interface/Widget.h>
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user