(svn r25668) -Codechange: Pass proper Unicode UCS-4 characters instead of just UCS-2 to the window key press handlers.

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
michi_cc 11 years ago
parent 923eb009e8
commit b911f4a452

@ -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()) {

@ -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;

@ -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;

@ -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;

@ -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

@ -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) {

@ -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) {

@ -800,7 +800,7 @@ public:
}
}
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
virtual EventState OnKeyPress(WChar key, uint16 keycode)
{
switch (keycode) {
case WKC_UP:

@ -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;

@ -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;

@ -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. */

@ -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);

Loading…
Cancel
Save