src/video/win32_v.cpp
changeset 6539 71cb3360be11
parent 6491 00dc414c909d
child 6615 74ec6e68e831
equal deleted inserted replaced
6538:3663bab358d6 6539:71cb3360be11
   210 }
   210 }
   211 
   211 
   212 static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
   212 static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
   213 {
   213 {
   214 	static uint32 keycode = 0;
   214 	static uint32 keycode = 0;
       
   215 	static bool console = false;
   215 
   216 
   216 	switch (msg) {
   217 	switch (msg) {
   217 		case WM_CREATE:
   218 		case WM_CREATE:
   218 			SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc);
   219 			SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc);
   219 			break;
   220 			break;
   361 			if (len != 0) _codepage = _ttoi(locale);
   362 			if (len != 0) _codepage = _ttoi(locale);
   362 			return 1;
   363 			return 1;
   363 		}
   364 		}
   364 #endif /* UNICODE */
   365 #endif /* UNICODE */
   365 
   366 
       
   367 		case WM_DEADCHAR:
       
   368 			console = GB(lParam, 16, 8) == 41;
       
   369 			return 0;
       
   370 
   366 		case WM_CHAR: {
   371 		case WM_CHAR: {
   367 			/* Silently drop all non-text messages as those were handled by WM_KEYDOWN */
   372 			/* Silently drop all non-text messages as those were handled by WM_KEYDOWN */
   368 			if (wParam < VK_SPACE) return 0;
   373 			if (wParam < VK_SPACE) return 0;
   369 			uint scancode = GB(lParam, 16, 8);
   374 			uint scancode = GB(lParam, 16, 8);
   370 			uint charcode = wParam;
   375 			uint charcode = wParam;
       
   376 
       
   377 			/* If the console key is a dead-key, we need to press it twice to get a WM_CHAR message.
       
   378 			 * But we then get two WM_CHAR messages, so ignore the first one */
       
   379 			if (console && scancode == 41) {
       
   380 				console = false;
       
   381 				return 0;
       
   382 			}
   371 
   383 
   372 #if !defined(UNICODE)
   384 #if !defined(UNICODE)
   373 			wchar_t w;
   385 			wchar_t w;
   374 			int len = MultiByteToWideChar(_codepage, 0, (char*)&charcode, 1, &w, 1);
   386 			int len = MultiByteToWideChar(_codepage, 0, (char*)&charcode, 1, &w, 1);
   375 			charcode = len == 1 ? w : 0;
   387 			charcode = len == 1 ? w : 0;