Keyboard handling (Original Enhancement)
Function
GetKeyState(n)
Identical with GetKeyState in Win32API.
This checks the key state.
The parameter is the virtual key code.
If the result is negative, the key is pushed, non-negative, not pushed.
[Reference]
The virtual key code of important keys
Enter 13 Shift 16 Ctrl 17 Alt 18 Esc 27 Space 32 ← 37 ↑ 38 → 39 ↓ 40 0~9 48~57 A~Z 65~90 0~9 (ten-key pad) 96~105
The virtual keycode of an alphabetic key is identical with the result of ORD function of its Upper case letter.
Example. Investigate Virtual KeycodesDO FOR i=8 TO 239 IF GetKeyState(i)<0 THEN PRINT i NEXT i LOOP END
[Warning]
Note that this commands does not do key input but peeps in key state. When any other application other than BASIC comes in the foreground, this continue to work but the key inputs are inputs for that application.