win32.c
changeset 719 0a8479b52125
parent 704 e843dd369938
child 792 baa707973bd5
equal deleted inserted replaced
718:0bb3e204abb5 719:0a8479b52125
   291 		}
   291 		}
   292 		MyShowCursor(false);
   292 		MyShowCursor(false);
   293 		return 0;
   293 		return 0;
   294 	}
   294 	}
   295 
   295 
   296 	case WM_CHAR: {
       
   297 		uint16 scancode = (( lParam & 0xFF0000 ) >> 16 );
       
   298 		if( scancode == 41 )
       
   299 			_pressed_key = WKC_BACKQUOTE << 16;
       
   300 	} break;
       
   301 	
       
   302 	
       
   303 	case WM_KEYDOWN: {
   296 	case WM_KEYDOWN: {
   304 		// this is the rewritten ascii input function
   297 		// this is the rewritten ascii input function
   305 		// it disables windows deadkey handling --> more linux like :D
   298 		// it disables windows deadkey handling --> more linux like :D
   306     unsigned short w = 0;
   299     unsigned short w = 0;
   307 		int r = 0;
   300 		int r = 0;
   308 		byte ks[256];
   301 		byte ks[256];
   309 		unsigned int scan = 0;
   302 		unsigned int scan = 0;
       
   303 		uint16 scancode = (( lParam & 0xFF0000 ) >> 16 );
       
   304 
   310 		GetKeyboardState(ks);
   305 		GetKeyboardState(ks);
   311 		r = ToAscii(wParam, scan, ks, &w, 0);
   306 		r = ToAscii(wParam, scan, ks, &w, 0);
   312 		if (r == 0) w = 0; // no translation was possible
   307 		if (r == 0) w = 0; // no translation was possible
   313 
   308 
   314 		_pressed_key = w | MapWindowsKey(wParam) << 16;
   309 		_pressed_key = w | MapWindowsKey(wParam) << 16;
       
   310 
       
   311 		if( scancode == 41 )
       
   312 			_pressed_key = w | WKC_BACKQUOTE << 16;
   315 
   313 
   316 		if ((_pressed_key>>16) == ('D' | WKC_CTRL) && !_wnd.fullscreen) {
   314 		if ((_pressed_key>>16) == ('D' | WKC_CTRL) && !_wnd.fullscreen) {
   317 			_double_size ^= 1;
   315 			_double_size ^= 1;
   318 			_wnd.double_size = _double_size;
   316 			_wnd.double_size = _double_size;
   319 			ClientSizeChanged(_wnd.width, _wnd.height);
   317 			ClientSizeChanged(_wnd.width, _wnd.height);