Use the arrow keys to move around and space to talk. X opens the menu and is also the back button.
Scratch projects do not have the capacity for a complete Pokemon game, so this was the best I could do before it stopped letting me save.