You have an animation and call it something like IDLE and another animation call it Walk.
You set the animation to change when you press a key or do some other event.
Both animations are under the same Sprite name so you are not changing sprites just the animation.
The animation of WALK is set to loop so it appears to walk any time that animation is called.
Most games use WASD for direction movements and QEZX can be used for the additional 4 angle directions.
You could use the number pad but many tablets do not include a number pad so that is limiting the users.
You can use two keys read as KEY IS DOWN and KEY IS DOWN to get 8 direction movement but that gets real tricky as you will get slash over as you change fingers from one key to the next.