Compare commits

..

2 Commits

Author SHA1 Message Date
631c920eb6 stop counting os key repeats as inputs and add is_action_stop 2026-09-26 12:37:21 +03:00
113c8444c4 get rid of mise 2026-09-20 18:20:30 +03:00
3 changed files with 7 additions and 5 deletions

View File

@ -1,4 +0,0 @@
[tasks]
build_web = "$HOME/bin/jai/bin/jai-linux first.jai - wasm release && rm -rf dist/packs/ && cp -r packs/ dist/ && rm dist/main.o"
ship_web = "./game/ship_web.sh"
start = "$HOME/bin/jai/bin/jai-linux first.jai && ./first"

View File

@ -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;

View File

@ -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();
}