diff options
author | kdx <kikoodx@paranoici.org> | 2022-12-10 01:25:25 +0100 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2022-12-10 01:25:25 +0100 |
commit | 2f42c47156cfc118a40a932e10f59f0d8fb1669d (patch) | |
tree | 98ec3a699e510c2db99d159d5fd5404e085f7155 | |
parent | 5e04faf8ff92c35de01a1f69801b5625f13a681b (diff) | |
download | lzr-2f42c47156cfc118a40a932e10f59f0d8fb1669d.tar.gz |
fix bind
-rw-r--r-- | lzr.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -46,7 +46,7 @@ static int mouse_y = 0; static int _scode_to_button(unsigned int scode) { - for (int i = 0; i < LZR_BUTTON_COUNT; i++) + for (int i = 0; i < LZR_BUTTON_MOUSE_L; i++) if (map[i] == scode) return i; return -1; @@ -102,7 +102,7 @@ static void _bind_menu(void) } int btn = 0; SDL_Event e; - while (btn < LZR_BUTTON_COUNT) { + while (btn < LZR_BUTTON_MOUSE_L) { while (SDL_PollEvent(&e)) { if (e.type != SDL_KEYDOWN || e.key.repeat || e.key.keysym.scancode == SCODE_BIND_MENU || @@ -422,7 +422,7 @@ bool LZR_ButtonDown(LZR_Button btn) void LZR_ButtonBind(LZR_Button btn, unsigned int code) { - if (btn < LZR_BUTTON_COUNT && code != SCODE_BIND_MENU) { + if (btn < LZR_BUTTON_MOUSE_L && code != SCODE_BIND_MENU) { map[btn] = code; dx_log_trace("bound key %s to button %u", SDL_GetScancodeName(map[btn]), btn); |