Take a look at AnimatedSprite. You can check if given animation is currently playing, you can stop and start or check which frame is actually playing (that can be used to blend animations).
What you can do:
Check for input, if player pressed Right Key, stop idle animation, start walking animation. If player released Right Key, stop walking animation, start idle animation.
Edit
Click on AnimatedSprite
inside scene tree, in properties click on created Frames
so it will open Animation Frames
interface. Create animations there, name will be used in code (play(animation name)
or animation == animation_name
). Throw there all frames that are related to given animation and done.