src/video/x11/SDL_x11events.c
changeset 14 c3e9d4a623c1
parent 12 34d956b20f75
child 75 b0ae59d0f3ee
     1.1 --- a/src/video/x11/SDL_x11events.c	Sun Apr 29 23:00:03 2001 +0000
     1.2 +++ b/src/video/x11/SDL_x11events.c	Tue May 01 21:12:57 2001 +0000
     1.3 @@ -54,6 +54,9 @@
     1.4  #include "SDL_x11events_c.h"
     1.5  
     1.6  
     1.7 +/* Define this if you want to debug X11 events */
     1.8 +/*#define DEBUG_XEVENTS*/
     1.9 +
    1.10  /* The translation tables from an X11 keysym to a SDL keysym */
    1.11  static SDLKey ODD_keymap[256];
    1.12  static SDLKey MISC_keymap[256];
    1.13 @@ -219,6 +222,9 @@
    1.14  
    1.15  	    /* Generated upon EnterWindow and FocusIn */
    1.16  	    case KeymapNotify: {
    1.17 +#ifdef DEBUG_XEVENTS
    1.18 +printf("KeymapNotify!\n");
    1.19 +#endif
    1.20  		X11_SetKeyboardState(SDL_Display, xevent.xkeymap.key_vector);
    1.21  	    }
    1.22  	    break;
    1.23 @@ -263,6 +269,10 @@
    1.24  	    /* Key press? */
    1.25  	    case KeyPress: {
    1.26  		SDL_keysym keysym;
    1.27 +
    1.28 +#ifdef DEBUG_XEVENTS
    1.29 +printf("KeyPress (X11 keycode = 0x%X)\n", xevent.xkey.keycode);
    1.30 +#endif
    1.31  		posted = SDL_PrivateKeyboard(SDL_PRESSED,
    1.32  				X11_TranslateKey(SDL_Display, &xevent.xkey,
    1.33  						 xevent.xkey.keycode,
    1.34 @@ -274,6 +284,9 @@
    1.35  	    case KeyRelease: {
    1.36  		SDL_keysym keysym;
    1.37  
    1.38 +#ifdef DEBUG_XEVENTS
    1.39 +printf("KeyRelease (X11 keycode = 0x%X)\n", xevent.xkey.keycode);
    1.40 +#endif
    1.41  		/* Check to see if this is a repeated key */
    1.42  		if ( ! X11_KeyRepeat(SDL_Display, &xevent) ) {
    1.43  			posted = SDL_PrivateKeyboard(SDL_RELEASED,