Skip to content

Commit

Permalink
Try to avoid invalid scancodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vagabond committed Jun 25, 2024
1 parent 05ade32 commit 1d379c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/game/scenes/mainmenu/menu_presskey.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void menu_presskey_tick(component *c) {
// See if a key has been pressed
int keys = 0;
const unsigned char *state = SDL_GetKeyboardState(&keys);
for(int i = 0; i < keys; i++) {
for(int i = SDL_SCANCODE_A; i < keys; i++) {
if(state[i]) {
if(is_key_bound(i) && strcmp(SDL_GetScancodeName(i), *(local->key)) != 0) {
// Set texts to red as a warning
Expand Down

0 comments on commit 1d379c7

Please sign in to comment.