如何知道在 SDL2 中按下了哪些键

How to know which keys are pressed in SDL2

我如何知道当前在 SDL2 中按下了哪些键(不是事件)?

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

其中 ??? 是键名,those 之一。