does anyone know how to detect button presses (like A,B,X,Y) using SDL?
I used a certain method (code below) to detect those buttons before but I tried to use the same method recently and it just doesn't do anything anymore. no button presses are being detected, and I'm not sure why button press detection is broken.
the code snippet in question:
the code above should detect if either A or B is pressed and exit the loop but nothing is being detected. any help would be appreciated.
I used a certain method (code below) to detect those buttons before but I tried to use the same method recently and it just doesn't do anything anymore. no button presses are being detected, and I'm not sure why button press detection is broken.
the code snippet in question:
Code:
int running = 1;
SDL_Event event;
while(running) {
while(SDL_PollEvent(&event)) {
switch(event.key.keysym.sym) {
case 'a':
running = 0;
break;
case 'b':
running = 0;
break;
}
}
the code above should detect if either A or B is pressed and exit the loop but nothing is being detected. any help would be appreciated.






