How to know which keys are pressed in SDL2

Viewed 61

How would I know what keys are currently being pressed in SDL2 (not event)?

1 Answers
if (SDL_GetKeyboardState(nullptr)[SDL_SCANCODE_???]) {/*the key is held*/}

where ??? is a key name, one of those.

Related