diff src/video/wincommon/SDL_sysevents.c @ 1282:217f5d5a49e5

Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC) From: jimrandomh Subject: [SDL] Re: Modifier keys pressed during initialization stick I wrote a simple test program which initializes SDL, prints the SDL version number, then prints any keydown and keyup events with their modifiers. (Source code below). Compilation was done using Visual Studio 6, release mode. My test sequence was: Start a command prompt. Type the name of the test program. shift down enter down (program starts) Wait for window to appear enter up shift up spacebar down spacebar up Under Windows 98, the output was correct: SDL 1.2.8 left shift down shift-return down shift-return up left shift up space down space up Under Windows 2000 and under Windows XP, the output was: SDL 1.2.8 shift-space down shift-space up Since shift was not held at the time space was pressed, this is incorrect. Similar results were observed with launching in different ways (including double-clicking in Windows Explorer), so it does not depend on the launching terminal.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 29 Jan 2006 07:57:13 +0000
parents f61f045343d3
children 15a89a0c52bf
line wrap: on
line diff
--- a/src/video/wincommon/SDL_sysevents.c	Sun Jan 29 06:40:13 2006 +0000
+++ b/src/video/wincommon/SDL_sysevents.c	Sun Jan 29 07:57:13 2006 +0000
@@ -214,21 +214,27 @@
 	if ( GetKeyboardState(keyboard) ) {
 		if ( keyboard[VK_LSHIFT] & 0x80) {
 			state |= KMOD_LSHIFT;
+			kstate[SDLK_LSHIFT] = SDL_PRESSED;
 		}
 		if ( keyboard[VK_RSHIFT] & 0x80) {
 			state |= KMOD_RSHIFT;
+			kstate[SDLK_RSHIFT] = SDL_PRESSED;
 		}
 		if ( keyboard[VK_LCONTROL] & 0x80) {
 			state |= KMOD_LCTRL;
+			kstate[SDLK_LCTRL] = SDL_PRESSED;
 		}
 		if ( keyboard[VK_RCONTROL] & 0x80) {
 			state |= KMOD_RCTRL;
+			kstate[SDLK_RCTRL] = SDL_PRESSED;
 		}
 		if ( keyboard[VK_LMENU] & 0x80) {
 			state |= KMOD_LALT;
+			kstate[SDLK_LALT] = SDL_PRESSED;
 		}
 		if ( keyboard[VK_RMENU] & 0x80) {
 			state |= KMOD_RALT;
+			kstate[SDLK_RALT] = SDL_PRESSED;
 		}
 		if ( keyboard[VK_NUMLOCK] & 0x01) {
 			state |= KMOD_NUM;