Universal key code that doesn’t depend on the system keyboard layout
scancode - SDL physical key code. Docs: SDL3/SDL_Keysym - SDL Wiki
switch (event->type)
{
case SDL_EVENT_KEY_DOWN:
{
if (event->key.keysym.scancode == SDL_SCANCODE_T) // The 't' key
{
std::cout << "You pressed the 't' key" << std::endl;
}
break;
}
case SDL_EVENT_QUIT:
{
app->app_quit = SDL_TRUE;
break;
}
default:
{
break;
}
}