Another thing to remember:
If you are writing a program for yourself then ScanCode() is OK.
But if it's for use by other people, then remember that Inkey$() is the only method which will work with specific character keys on keyboards in
all countries.
This is because Inkey$() responds to the keyboard character pressed (a, A etc) whereas ScanCode() responds to the
physical key pressed and not all keyboards have the same thing on every key.
For example, on my Spanish QWERTY keyboard, (like UK and US keyboards), the ScanCode() code for the character a/A is 30.
In France however, using an AZERTY keyboard, if your program is polling for the A key you need to check for the ScanCode() value 16 - not 30. So if your program instructions say to press the A key but it is actually checking for the value 30 then you would be checking for the Q key.
There are also QWERTZ and other non-English keyboards (the majority of which I know you can disregard).
If the Inkey$() command needs to respond to a or A (ignoring the Caps Lock or Shift setting), simply use:
I$ = Upper$(Inkey$())
If I$="A" Then Do Something
or...
I$ = Lower$(Inkey$())
If I$="a" Then Do Something
TDK