In the old QBasic days, we used INP for that, which is still available in QB64. INP has some baggage of its own, as to how to implement it properly. The new key functions, like the example given in a previous text, would probably be your best bet. QB64 aslso offers _KEYCLEAR, if you need to clear the keyboard buffer.
INKEY$ is great for text programs, but was not made gaming.
Pete