diff options
author | peter1138 <peter1138@openttd.org> | 2006-11-16 22:05:33 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-11-16 22:05:33 +0000 |
commit | 1a4f1c8177f7ee351cb0096e3456d055b97dc60a (patch) | |
tree | 4fb6c0fac873efffc85cef437baa70d50d51fdfb /video | |
parent | 40d647ddde652bb8f1c7b4215279cc82d01ca38f (diff) | |
download | openttd-1a4f1c8177f7ee351cb0096e3456d055b97dc60a.tar.xz |
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
Diffstat (limited to 'video')
-rw-r--r-- | video/win32_v.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/video/win32_v.c b/video/win32_v.c index 1894e7a24..7511df597 100644 --- a/video/win32_v.c +++ b/video/win32_v.c @@ -349,14 +349,15 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP case WM_KEYDOWN: { // this is the rewritten ascii input function // it disables windows deadkey handling --> more linux like :D - WORD w = 0; + wchar_t w = 0; byte ks[256]; uint scancode; uint32 pressed_key; GetKeyboardState(ks); - if (ToAscii(wParam, 0, ks, &w, 0) == 0) { - w = 0; // no translation was possible + if (ToUnicode(wParam, 0, ks, &w, 1, 0) == 0) { + /* On win9x ToUnicode always fails, so fall back to ToAscii */ + if (ToAscii(wParam, 0, ks, &w, 0) == 0) w = 0; // no translation was possible } pressed_key = w | MapWindowsKey(wParam) << 16; |