UberSuperBoss
UberSuperBoss

Reputation: 77

How to know which keys are pressed in SDL2

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

Upvotes: 2

Views: 146

Answers (1)

HolyBlackCat
HolyBlackCat

Reputation: 96091

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

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

Upvotes: 4

Related Questions