qbasicking:
If you see the original posting, the A$ is used solitarily which indicates that 'Lewis Green' is expecting a single byte character returned instead of a two-byte return--which is what 'GodofCuboids' is showing.
Although, I do not program for games (mostly business applications for antiquated systems--dare I say "cheap bosses"

. I'd have to say that using RIGHT$ is very cleaver.
However, if the CAPS LOCK is
ON or the SHIFT key(s) is/are pressed then someone else--let us say in dual player mode for example--can press either a 'k', 'm', 'h', or a 'p'. It will be interpreted as thought it was from the extended keys. Which is not good for the user at the arrow keys. So that is why I said your code is character based.
What 'GodofCuboids' has indicated is correct. A two-byte return is needed to verify that the actual scan code being returned
IS from the extend arrow keys. Not simply a fluke that the CAPS LOCK or the SHIFT key was pressed.
Test it out. Use the arrow keys then press either SHIFT key or have the CAPS LOCK set to ON. You'll see.
--MiggyD It's better to have two heads to solve a problem from different angles than to have tunnel vision to a dead end.