echo and exact match input

This commit is contained in:
mehbark 2025-05-01 16:37:21 -04:00
parent 4310cd14f1
commit 82b10bdae5

18
main.gd
View file

@ -23,21 +23,19 @@ func _ready() -> void:
break break
func _input(event: InputEvent) -> void: func _input(event: InputEvent) -> void:
if event.is_action_pressed("u"): if event.is_action_pressed("u", true, true):
step(Vector2i.UP) step(Vector2i.UP)
elif event.is_action_pressed("d"): elif event.is_action_pressed("d", true, true):
step(Vector2i.DOWN) step(Vector2i.DOWN)
elif event.is_action_pressed("l"): elif event.is_action_pressed("l", true, true):
step(Vector2i.LEFT) step(Vector2i.LEFT)
elif event.is_action_pressed("r"): elif event.is_action_pressed("r", true, true):
step(Vector2i.RIGHT) step(Vector2i.RIGHT)
# because most redo keybinds are a superset of undo, we check them first elif event.is_action_pressed("undo", true, true):
# e.g. if C-Z, then C-z is pressed
elif event.is_action_pressed("redo"):
hist.redo()
elif event.is_action_pressed("undo"):
hist.undo() 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() restart()
# TODO: # TODO: