Hi! I'm using SDL to try to create a Run and Shoot game. But I do not know how to check if a key is down while the user is HOLDING it.
I do know how to check if a key was pressed.
I have tried with the "event.key.keysym.sym" and "Uint8 *keystate = GetKeyState(NULL)" both worked to check if a key was down but I thought that the GetKeyState(); Function would even check when a key where HELD down
My idea of this is that I want my player to move while holding down left or right arrow. So I did something like:
Can someone help me out. Just let me know how to check if a key is held down? Please!Code:Uint8 *keystate = GetKeyState(NULL); if (keystate[SDLK_RIGHT]) { apply_surface(x++, y, player, screen); }