1
0
Fork 0

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

release/1.4
michi_cc 2013-08-05 20:36:24 +00:00
parent 923eb009e8
commit b911f4a452
12 changed files with 13 additions and 12 deletions

View File

@ -241,7 +241,7 @@ public:
} }
} }
virtual EventState OnKeyPress(uint16 key, uint16 keycode) virtual EventState OnKeyPress(WChar key, uint16 keycode)
{ {
const uint8 i = keycode - '1'; const uint8 i = keycode - '1';
if (i < 9 && i < this->bridges->Length()) { if (i < 9 && i < this->bridges->Length()) {

View File

@ -236,7 +236,7 @@ struct IConsoleWindow : Window
if (_iconsole_cmdline.HandleCaret()) this->SetDirty(); 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; if (_focused_window != this) return ES_NOT_HANDLED;

View File

@ -300,7 +300,7 @@ public:
if (_window_system_initialized) ShowFirstError(); 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; if (keycode != WKC_SPACE) return ES_NOT_HANDLED;
delete this; delete this;

View File

@ -618,7 +618,7 @@ public:
} }
} }
virtual EventState OnKeyPress(uint16 key, uint16 keycode) virtual EventState OnKeyPress(WChar key, uint16 keycode)
{ {
if (keycode == WKC_ESC) { if (keycode == WKC_ESC) {
delete this; delete this;

View File

@ -63,7 +63,7 @@ struct EndGameHighScoreBaseWindow : Window {
delete this; 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 /* All keys are 'handled' by this window but we want to make
* sure that 'quit' still works correctly. Not handling the * sure that 'quit' still works correctly. Not handling the

View File

@ -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 */ /* ESC closes the window, Enter confirms the action */
switch (keycode) { switch (keycode) {

View File

@ -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; EventState state = ES_NOT_HANDLED;
if (keycode == WKC_TAB) { if (keycode == WKC_TAB) {

View File

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

View File

@ -799,7 +799,7 @@ public:
this->SetDirty(); this->SetDirty();
} }
virtual EventState OnKeyPress(uint16 key, uint16 keycode) virtual EventState OnKeyPress(WChar key, uint16 keycode)
{ {
EventState state = ES_NOT_HANDLED; EventState state = ES_NOT_HANDLED;

View File

@ -1235,7 +1235,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback {
this->SetWidgetDisabledState(WID_NS_PRESET_SAVE, has_missing); 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; if (!this->editable) return ES_NOT_HANDLED;

View File

@ -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) { if (keycode == WKC_SPACE) {
/* Don't continue. */ /* Don't continue. */

View File

@ -19,6 +19,7 @@
#include "widget_type.h" #include "widget_type.h"
#include "core/smallvec_type.hpp" #include "core/smallvec_type.hpp"
#include "core/smallmap_type.hpp" #include "core/smallmap_type.hpp"
#include "string_type.h"
/** /**
* Flags to describe the look of the frame * 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 * @return #ES_HANDLED if the key press has been handled and no other
* window should receive the event. * 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); virtual EventState OnHotkey(int hotkey);