Fast keyboard repeat code

Here’s some old code that I found that uses the Console… i’m not at
home right now, but later tonight i will post one that doesn’t use the
console…

You will probably have to paste it in a bigger window to read it. hehe.

while (quit_game == FALSE) {
if (show_console == TRUE) {
DrawConsole();
SDL_UpdateRect(screen, 0,0,0,0);
} else {

SDL_FillRect(screen,0,SDL_MapRGB(screen->format,0,0,0));
DisplayLogo(screen, “graphics/help.dat”);
}
while (SDL_PollEvent(&event)) {
if ( event.type == SDL_QUIT) {
quit_game = TRUE;
}

                    if ( event.type == SDL_KEYDOWN) {
                                    if ( event.key.keysym.sym ==

SDLK_BACKQUOTE) {
if (show_console == FALSE)
{
show_console =
TRUE;

SDL_EnableUNICODE(1);
} else {
show_console =
FALSE;

SDL_EnableUNICODE(0);
}
}

                                    if ( event.key.keysym.sym ==

SDLK_ESCAPE) {
quit_game = TRUE;
}
if ( show_console == TRUE ) {
ConsoleEvents(&event);
}
}
}