SDL KeyEvents SDL KeyEvents

You wrote:
I’m having trouble implementing a keypress handler. I’m using code
from the examples in the SDL doc. When I poll for events, I detect a
KeyDown Event. But regardless of what key I press, SDL says the key is
unknown. The keysym.scancode values change, but the keysym.sym says
Try something like this:

void ActionHandler()
SDL_Event e;

            if (e.type==SDL_KEYDOWN)
                    if (e.key.keysym.sym==SDLK_SPACE)
            if (e.key.keysym.sym==SDLK_RETURN)
            if (e.key.keysym.sym==SDLK_q)
                   { gGameLoop = 0;}

            }/* end while*/

See if that works for you. I found something similar in a tutorial and it does the job for me.