src/video/wincommon/SDL_sysevents.c
changeset 327 13fc64213765
parent 304 ec53caed9fb2
child 332 3d6dd1b7b7ba
equal deleted inserted replaced
326:72d55d02cb47 327:13fc64213765
   129 static void WIN_GetKeyboardState(void)
   129 static void WIN_GetKeyboardState(void)
   130 {
   130 {
   131 #ifndef NO_GETKEYBOARDSTATE
   131 #ifndef NO_GETKEYBOARDSTATE
   132 	SDLMod state;
   132 	SDLMod state;
   133 	BYTE keyboard[256];
   133 	BYTE keyboard[256];
       
   134 	Uint8 *kstate = SDL_GetKeyState(NULL);
   134 
   135 
   135 	state = KMOD_NONE;
   136 	state = KMOD_NONE;
   136 	if ( GetKeyboardState(keyboard) ) {
   137 	if ( GetKeyboardState(keyboard) ) {
   137 		if ( keyboard[VK_LSHIFT] & 0x80) {
   138 		if ( keyboard[VK_LSHIFT] & 0x80) {
   138 			state |= KMOD_LSHIFT;
   139 			state |= KMOD_LSHIFT;
   152 		if ( keyboard[VK_RMENU] & 0x80) {
   153 		if ( keyboard[VK_RMENU] & 0x80) {
   153 			state |= KMOD_RALT;
   154 			state |= KMOD_RALT;
   154 		}
   155 		}
   155 		if ( keyboard[VK_NUMLOCK] & 0x01) {
   156 		if ( keyboard[VK_NUMLOCK] & 0x01) {
   156 			state |= KMOD_NUM;
   157 			state |= KMOD_NUM;
       
   158 			kstate[SDLK_NUMLOCK] = SDL_PRESSED;
   157 		}
   159 		}
   158 		if ( keyboard[VK_CAPITAL] & 0x01) {
   160 		if ( keyboard[VK_CAPITAL] & 0x01) {
   159 			state |= KMOD_CAPS;
   161 			state |= KMOD_CAPS;
       
   162 			kstate[SDLK_CAPSLOCK] = SDL_PRESSED;
   160 		}
   163 		}
   161 	}
   164 	}
   162 	SDL_SetModState(state);
   165 	SDL_SetModState(state);
   163 #endif /* !NO_GETKEYBOARDSTATE */
   166 #endif /* !NO_GETKEYBOARDSTATE */
   164 }
   167 }