diff src/video/x11/SDL_x11events.c @ 14:c3e9d4a623c1

Fixed stuck keys when changing the video mode
author Sam Lantinga <slouken@lokigames.com>
date Tue, 01 May 2001 21:12:57 +0000
parents 34d956b20f75
children b0ae59d0f3ee
line wrap: on
line diff
--- a/src/video/x11/SDL_x11events.c	Sun Apr 29 23:00:03 2001 +0000
+++ b/src/video/x11/SDL_x11events.c	Tue May 01 21:12:57 2001 +0000
@@ -54,6 +54,9 @@
 #include "SDL_x11events_c.h"
 
 
+/* Define this if you want to debug X11 events */
+/*#define DEBUG_XEVENTS*/
+
 /* The translation tables from an X11 keysym to a SDL keysym */
 static SDLKey ODD_keymap[256];
 static SDLKey MISC_keymap[256];
@@ -219,6 +222,9 @@
 
 	    /* Generated upon EnterWindow and FocusIn */
 	    case KeymapNotify: {
+#ifdef DEBUG_XEVENTS
+printf("KeymapNotify!\n");
+#endif
 		X11_SetKeyboardState(SDL_Display, xevent.xkeymap.key_vector);
 	    }
 	    break;
@@ -263,6 +269,10 @@
 	    /* Key press? */
 	    case KeyPress: {
 		SDL_keysym keysym;
+
+#ifdef DEBUG_XEVENTS
+printf("KeyPress (X11 keycode = 0x%X)\n", xevent.xkey.keycode);
+#endif
 		posted = SDL_PrivateKeyboard(SDL_PRESSED,
 				X11_TranslateKey(SDL_Display, &xevent.xkey,
 						 xevent.xkey.keycode,
@@ -274,6 +284,9 @@
 	    case KeyRelease: {
 		SDL_keysym keysym;
 
+#ifdef DEBUG_XEVENTS
+printf("KeyRelease (X11 keycode = 0x%X)\n", xevent.xkey.keycode);
+#endif
 		/* Check to see if this is a repeated key */
 		if ( ! X11_KeyRepeat(SDL_Display, &xevent) ) {
 			posted = SDL_PrivateKeyboard(SDL_RELEASED,