diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 04a6e37607..61c477aeac 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -241,7 +241,7 @@ public: } } - virtual EventState OnKeyPress(uint16 key, uint16 keycode) + virtual EventState OnKeyPress(WChar key, uint16 keycode) { const uint8 i = keycode - '1'; if (i < 9 && i < this->bridges->Length()) { diff --git a/src/console_gui.cpp b/src/console_gui.cpp index 33e2ed1c54..dc9a0cb795 100644 --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -236,7 +236,7 @@ struct IConsoleWindow : Window if (_iconsole_cmdline.HandleCaret()) this->SetDirty(); } - virtual EventState OnKeyPress(uint16 key, uint16 keycode) + virtual EventState OnKeyPress(WChar key, uint16 keycode) { if (_focused_window != this) return ES_NOT_HANDLED; diff --git a/src/error_gui.cpp b/src/error_gui.cpp index ccbc18850b..b498cff63e 100644 --- a/src/error_gui.cpp +++ b/src/error_gui.cpp @@ -300,7 +300,7 @@ public: if (_window_system_initialized) ShowFirstError(); } - virtual EventState OnKeyPress(uint16 key, uint16 keycode) + virtual EventState OnKeyPress(WChar key, uint16 keycode) { if (keycode != WKC_SPACE) return ES_NOT_HANDLED; delete this; diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index c3ef3b7170..9551bb843e 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -618,7 +618,7 @@ public: } } - virtual EventState OnKeyPress(uint16 key, uint16 keycode) + virtual EventState OnKeyPress(WChar key, uint16 keycode) { if (keycode == WKC_ESC) { delete this; diff --git a/src/highscore_gui.cpp b/src/highscore_gui.cpp index 9b832e3f5e..d79afe4ebd 100644 --- a/src/highscore_gui.cpp +++ b/src/highscore_gui.cpp @@ -63,7 +63,7 @@ struct EndGameHighScoreBaseWindow : Window { delete this; } - virtual EventState OnKeyPress(uint16 key, uint16 keycode) + virtual EventState OnKeyPress(WChar key, uint16 keycode) { /* All keys are 'handled' by this window but we want to make * sure that 'quit' still works correctly. Not handling the diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index b10c037f66..87847ba70b 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -1027,7 +1027,7 @@ struct QueryWindow : public Window { } } - virtual EventState OnKeyPress(uint16 key, uint16 keycode) + virtual EventState OnKeyPress(WChar key, uint16 keycode) { /* ESC closes the window, Enter confirms the action */ switch (keycode) { diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index 09d39b0375..5fa311ba1e 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -491,7 +491,7 @@ struct NetworkChatWindow : public Window { } } - virtual EventState OnKeyPress(uint16 key, uint16 keycode) + virtual EventState OnKeyPress(WChar key, uint16 keycode) { EventState state = ES_NOT_HANDLED; if (keycode == WKC_TAB) { diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 358187cc28..3297b00718 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -800,7 +800,7 @@ public: } } - virtual EventState OnKeyPress(uint16 key, uint16 keycode) + virtual EventState OnKeyPress(WChar key, uint16 keycode) { switch (keycode) { case WKC_UP: diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index be028355ef..7d2e47dbc0 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -799,7 +799,7 @@ public: this->SetDirty(); } - virtual EventState OnKeyPress(uint16 key, uint16 keycode) + virtual EventState OnKeyPress(WChar key, uint16 keycode) { EventState state = ES_NOT_HANDLED; diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 6ba2ade704..287ed0939f 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -1235,7 +1235,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { this->SetWidgetDisabledState(WID_NS_PRESET_SAVE, has_missing); } - virtual EventState OnKeyPress(uint16 key, uint16 keycode) + virtual EventState OnKeyPress(WChar key, uint16 keycode) { if (!this->editable) return ES_NOT_HANDLED; diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 89448edea1..5639001b71 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -449,7 +449,7 @@ struct NewsWindow : Window { } } - virtual EventState OnKeyPress(uint16 key, uint16 keycode) + virtual EventState OnKeyPress(WChar key, uint16 keycode) { if (keycode == WKC_SPACE) { /* Don't continue. */ diff --git a/src/window_gui.h b/src/window_gui.h index 820d90e2bb..433ed87292 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -19,6 +19,7 @@ #include "widget_type.h" #include "core/smallvec_type.hpp" #include "core/smallmap_type.hpp" +#include "string_type.h" /** * Flags to describe the look of the frame @@ -593,7 +594,7 @@ public: * @return #ES_HANDLED if the key press has been handled and no other * window should receive the event. */ - virtual EventState OnKeyPress(uint16 key, uint16 keycode) { return ES_NOT_HANDLED; } + virtual EventState OnKeyPress(WChar key, uint16 keycode) { return ES_NOT_HANDLED; } virtual EventState OnHotkey(int hotkey);