Try the program
Local k
0=>k
While k<>12 'it's k not equal 12
GetKey k
Cls
Text 1,1,k
WhileEnd
Start it and hold(!) any key (except [clear] - it stops the program). Look closely to the values.
:/ It prints something like x, 0, 0, x, x, x,0,x,0,x,0,0,x,... (where x is the key-number) :/
the only thing you can do is to say to the user to release the key and press it in an high frequency.

when the user then has the frequency the program checks the key-number the program will
always get x (when he/she/it presses the key short time before the program checks the number) or 0 (when he/she/it presses the key short time after the program checks the number)

or - another way - is the slow down the program with wait but this is not the correct way. :/