[SDL] Optional SDL 1.2 Key Repeat Behavior in 2.0 ?

RodrigoCard cuecax at gmail.com
Wed Feb 1 14:48:24 PST 2012


I know I can check the repeat flag in the KEYDOWN event, but my case is more specific.
My loop looks somewhat like this:

while (running) {
	SDL_WaitEvent(NULL);
	while (SDL_PollEvent(&e)) {
		// Handle Useful Events
	}	
	updateStuff();
}

I basically I want to let the updateStuff() run only when there is events that matter for it, and I filter all the stuff I dont need before  the main loop.
But SDL 2.0 keep firing KEYDOWN events (with repeat = 1), and updateStuff() is called needlessly.
in SDL 1.2 I can just disable key repeat and it works.
If I need to handle this case, it will complicate the code inside the while loop.

Is there any way to disable key repeat events currently?

Thanks




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20120201/cb8c7ab1/attachment-0007.htm>


More information about the SDL mailing list