diff --git a/modules/Input/sokol.jai b/modules/Input/sokol.jai index 2991f3a..13684c1 100644 --- a/modules/Input/sokol.jai +++ b/modules/Input/sokol.jai @@ -127,7 +127,9 @@ handle_sokol_event :: (event: *sapp_event) { new_event.key_code = mapped; new_event.key_pressed = 1; add_modifier_info(event, *new_event); - input_button_states[mapped] = .START | .DOWN; + // OS key-repeat must not re-trigger START + if event.key_repeat input_button_states[mapped] |= .DOWN; + else input_button_states[mapped] = .START | .DOWN; case .KEY_UP; mapped := get_key_code(event.key_code); new_event.type = .KEYBOARD; diff --git a/src/input/keybinds.jai b/src/input/keybinds.jai index 3d682ac..45197a1 100644 --- a/src/input/keybinds.jai +++ b/src/input/keybinds.jai @@ -103,6 +103,10 @@ is_action_start :: (action: $T) -> bool { return check_action(action, .START); } +is_action_stop :: (action: $T) -> bool { + return check_action(action, .END); +} + init_keybinds :: () { set_default_bindings(); }