Yes, I can help with this. Would you mind posting your movement code so I can modify it? I'll tell you the basic idea though. You just need to save the last direction that was pressed (you don't need a whole history buffer like the link, but that is useful for when you want to press multiple buttons at the same time and then release one of them and keep moving). In fact, you could do it without any history. Just save the current direction in a variable, like:
# global at top of script
var move_dir = Vector2.ZERO
var move_speed = 32
# logic for each button, can be in _physics_process
if Input.is_action_just_pressed("left"):
move_dir = Vector2.LEFT
if Input.is_action_just_pressed("right"):
move_dir = Vector2.RIGHT
# check if nothing is pressed
if !Input.is_action_pressed("left") and !Input.is_action_pressed("right") :
move_dir = Vector2.ZERO
This overwrites the direction each time a button is pressed, so it will always have the latest press. Then separately, lower down in your _physics_process() function, simply add move_dir to your player position, such as:
velocity = move_and_slide(move_dir * move_speed)
At least I think that should work. Maybe it will give you some ideas.