X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=vid_wgl.c;h=0adee1c6c485435294a29aa1f71e51fd0923d8de;hp=11eea0e26b890a9a54a7751134116f72c03d2725;hb=e572ffa56f0883c1ac7c9cca37da359ddbac551c;hpb=7da3f74c75363169da55547a5758a10735352b95 diff --git a/vid_wgl.c b/vid_wgl.c index 11eea0e2..0adee1c6 100644 --- a/vid_wgl.c +++ b/vid_wgl.c @@ -78,7 +78,6 @@ static qboolean vid_initialized = false; static qboolean vid_wassuspended = false; static qboolean vid_usingmouse = false; static qboolean vid_usingvsync = false; -static qboolean vid_usemouse = false; static qboolean vid_usevsync = false; static HICON hIcon; @@ -260,6 +259,8 @@ static void IN_StartupMouse (void); void VID_Finish (void) { + qboolean vid_usemouse; + vid_usevsync = vid_vsync.integer && !cls.timedemo && gl_videosyncavailable; if (vid_usingvsync != vid_usevsync && gl_videosyncavailable) { @@ -473,6 +474,7 @@ LONG WINAPI MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) char state[256]; char asciichar[4]; int vkey; + int charlength; qboolean down = false; if ( uMsg == uiWheelMessage ) @@ -503,8 +505,12 @@ LONG WINAPI MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) GetKeyboardState (state); // alt/ctrl/shift tend to produce funky ToAscii values, // and if it's not a single character we don't know care about it - if (vkey == K_ALT || vkey == K_CTRL || vkey == K_SHIFT || ToAscii (wParam, lParam >> 16, state, (unsigned short *)asciichar, 0) != 1) + charlength = ToAscii (wParam, lParam >> 16, state, (unsigned short *)asciichar, 0); + if (vkey == K_ALT || vkey == K_CTRL || vkey == K_SHIFT || charlength == 0) asciichar[0] = 0; + else if( charlength == 2 ) { + asciichar[0] = asciichar[1]; + } Key_Event (vkey, asciichar[0], down); break; @@ -689,7 +695,7 @@ void VID_Init(void) wc.lpszClassName = "DarkPlacesWindowClass"; if (!RegisterClass (&wc)) - Sys_Error("Couldn't register window class\n"); + Con_Printf ("Couldn't register window class\n"); IN_Init(); }