summaryrefslogtreecommitdiff
path: root/win32.c
diff options
context:
space:
mode:
authordominik <dominik@openttd.org>2004-12-19 13:28:09 +0000
committerdominik <dominik@openttd.org>2004-12-19 13:28:09 +0000
commit8c6c4e5262a0712081c421bfc8c8c00949982156 (patch)
tree79309b03c504d4d625b928badb9d300bb89a0559 /win32.c
parent18dd7ebae200528fbdbcf67e1d605e000553e3be (diff)
downloadopenttd-8c6c4e5262a0712081c421bfc8c8c00949982156.tar.xz
(svn r1171) Fix: Console hotkey works again on keyboards where this key is a deadkey.
Diffstat (limited to 'win32.c')
-rw-r--r--win32.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/win32.c b/win32.c
index 704326beb..98102760f 100644
--- a/win32.c
+++ b/win32.c
@@ -293,13 +293,6 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
return 0;
}
- case WM_CHAR: {
- uint16 scancode = (( lParam & 0xFF0000 ) >> 16 );
- if( scancode == 41 )
- _pressed_key = WKC_BACKQUOTE << 16;
- } break;
-
-
case WM_KEYDOWN: {
// this is the rewritten ascii input function
// it disables windows deadkey handling --> more linux like :D
@@ -307,12 +300,17 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
int r = 0;
byte ks[256];
unsigned int scan = 0;
+ uint16 scancode = (( lParam & 0xFF0000 ) >> 16 );
+
GetKeyboardState(ks);
r = ToAscii(wParam, scan, ks, &w, 0);
if (r == 0) w = 0; // no translation was possible
_pressed_key = w | MapWindowsKey(wParam) << 16;
+ if( scancode == 41 )
+ _pressed_key = w | WKC_BACKQUOTE << 16;
+
if ((_pressed_key>>16) == ('D' | WKC_CTRL) && !_wnd.fullscreen) {
_double_size ^= 1;
_wnd.double_size = _double_size;