feat(input): KeyBind will now longer respond to repeat keys

This commit is contained in:
Sara 2023-11-24 21:14:08 +01:00
parent eb871a9d5f
commit 14877b0a28

View file

@ -16,7 +16,8 @@ KeyBind* keybind_new(SDL_Scancode key) {
int keybind_is_changed_by(KeyBind* self, SDL_Event event) {
return self->device->type == InputDevice_KBM
&& (event.type == SDL_KEYUP || event.type == SDL_KEYDOWN)
&& event.key.keysym.scancode == self->scancode;
&& event.key.keysym.scancode == self->scancode
&& event.key.repeat == 0;
}
InputEvent keybind_evaluate(KeyBind* self, SDL_Event event) {