[SDL] Still experiencing some problems with Key Events...

Manuel García Cabrera manugarciac5 at yahoo.com.ar
Sun Jun 10 13:26:22 PDT 2007


...

SDL_Event event;

...

SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);

while(!exit){
	...
	while ( SDL_PollEvent(&event) ){
		...
		switch(event.type){
		...
		case SDL_KEYDOWN:
			//Some code
		...
		}
		...
	}
	...
}

...



Well, my program is executing the code inside the SDL_KEYDOWN case
indefinitely SOMETIMES... I mean, it may take 30 key presses before it
happens to give you an example. It behaves EXACTLY like it would if I
actually holded the key down. If I press any other key, it starts
behaving correctly again, until it happens again.

I thought that the problem could be my keyboard, but I tried it with
several keyboards and it does the same. Any ideas?


More information about the SDL mailing list