Perhaps before you create a 100+ line program with 4 keys to deal with (which doesn't work), you prototype your idea with a single key.

Such as
- you run the program, it waits for a key press
-...