Review

Events

An event loop (with a delay to keep it from being too tight):
SDL_Event event;
...
while (SDL_PollEvent(&event) != 0)
  {
    if (event.type == SDL_KEYDOWN)
      {
        /* Handle keypress... */
      }
    else if (event.type == SDL_KEYUP)
      {
        /* Handle keyrelease... */
      }

    /* Pause: */

    SDL_Delay(50);
  }