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
SDL_UNKNOWN.
Try something like this:

void ActionHandler()
{
SDL_Event e;

    while(SDL_PollEvent(&e))
            {
            if (e.type==SDL_KEYDOWN)
                    {
                    if (e.key.keysym.sym==SDLK_SPACE)
                    {CycleIcons();}
            
            
            if (e.key.keysym.sym==SDLK_RETURN)
                    {SelectIcon();}
                         
            if (e.key.keysym.sym==SDLK_q)
                   { gGameLoop = 0;}

            HideMessageBox();
                  }
            }/* end while*/
    }

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