How To Read Arrow Key

Keyboard event handling is a fun area. If you are fully intent on learning how that works, then I recommend reading through code that has done it, to understand what is needed.

This post contains some resources for learning: