Browse code

Pass through more keysyms when control is pressed.

d_m authored on 15/02/2023 02:32:56 • Devine Lu Linvega committed on 15/02/2023 02:33:51
Showing 1 changed files
... ...
@@ -341,11 +341,16 @@ get_vector_joystick(SDL_Event *event)
341 341
 static Uint8
342 342
 get_key(SDL_Event *event)
343 343
 {
344
+	int sym = event->key.keysym.sym;
344 345
 	SDL_Keymod mods = SDL_GetModState();
345
-	if(event->key.keysym.sym < 0x20 || event->key.keysym.sym == SDLK_DELETE)
346
-		return event->key.keysym.sym;
347
-	if((mods & KMOD_CTRL) && event->key.keysym.sym >= SDLK_a && event->key.keysym.sym <= SDLK_z)
348
-		return event->key.keysym.sym - (mods & KMOD_SHIFT) * 0x20;
346
+	if(sym < 0x20 || sym == SDLK_DELETE)
347
+		return sym;
348
+	if(mods & KMOD_CTRL) {
349
+		if(sym < SDLK_a)
350
+			return sym;
351
+		else if(sym <= SDLK_z)
352
+			return sym - (mods & KMOD_SHIFT) * 0x20;
353
+	}
349 354
 	return 0x00;
350 355
 }
351 356