diff --git a/main.gd b/main.gd index 5c804f3..94b2507 100644 --- a/main.gd +++ b/main.gd @@ -23,21 +23,19 @@ func _ready() -> void: break func _input(event: InputEvent) -> void: - if event.is_action_pressed("u"): + if event.is_action_pressed("u", true, true): step(Vector2i.UP) - elif event.is_action_pressed("d"): + elif event.is_action_pressed("d", true, true): step(Vector2i.DOWN) - elif event.is_action_pressed("l"): + elif event.is_action_pressed("l", true, true): step(Vector2i.LEFT) - elif event.is_action_pressed("r"): + elif event.is_action_pressed("r", true, true): step(Vector2i.RIGHT) - # because most redo keybinds are a superset of undo, we check them first - # e.g. if C-Z, then C-z is pressed - elif event.is_action_pressed("redo"): - hist.redo() - elif event.is_action_pressed("undo"): + elif event.is_action_pressed("undo", true, true): hist.undo() - elif event.is_action_pressed("restart"): + elif event.is_action_pressed("redo", true, true): + hist.redo() + elif event.is_action_pressed("restart", true, true): restart() # TODO: