comparison src/video/x11/SDL_x11events.c @ 12:34d956b20f75

Fix key repeat detection on newer X servers
author Sam Lantinga <slouken@lokigames.com>
date Sun, 29 Apr 2001 22:59:47 +0000
parents 5574376c451d
children c3e9d4a623c1
comparison
equal deleted inserted replaced
11:7b94b6379341 12:34d956b20f75
71 repeated = 0; 71 repeated = 0;
72 if ( XPending(display) ) { 72 if ( XPending(display) ) {
73 XPeekEvent(display, &peekevent); 73 XPeekEvent(display, &peekevent);
74 if ( (peekevent.type == KeyPress) && 74 if ( (peekevent.type == KeyPress) &&
75 (peekevent.xkey.keycode == event->xkey.keycode) && 75 (peekevent.xkey.keycode == event->xkey.keycode) &&
76 (peekevent.xkey.time == event->xkey.time) ) { 76 ((peekevent.xkey.time-event->xkey.time) < 2) ) {
77 repeated = 1; 77 repeated = 1;
78 XNextEvent(display, &peekevent); 78 XNextEvent(display, &peekevent);
79 } 79 }
80 } 80 }
81 return(repeated); 81 return(repeated);