[SDL] SDL_WaitEventTimeout

barrett at 9hells.org barrett at 9hells.org
Thu Nov 6 10:52:00 PST 2003


Hello David, and all others, I'm new to this list.
I subscribed because I'm having a problem with missing keys, and I expect 
to have some help here for more experienced SDL developers.

I work for a company that makes mp3 jukeboxes, mounted on arcade-like
machines. We also make a MAME-based arcade. As a hobby, I also develop
a SDL-based RTS game: http://palito.9hells.org/

In a new version of our jukebox, we use a barcode reader, that connects
to the keyboard input, and sends a sequence of digits, just like
regular keystrokes, when it reads a barcode card.

In my main loop, I do SDL_PollEvent(), and in case there's no event,
I do a SDL_Delay(1), just to prevent unecessary 100% CPU usage.
To my surprise, SDL is missing some keys! That shouldn't happen,
event if my event loop is not well designed, and is lagging to
catch the events, because (I think) there is an event queue (buffer),
right?  If I remove the SDL_Delay(), this doesn't happen.


Regards,
barrett




More information about the SDL mailing list