Some Inkey$ returns 2-byte values where in the first byte is Chr$(0) and the second byte up to 255.
Not all keyboard scancodes are trapped such as keypad-5 and ctrl-keypad-5 and using _keyhit can trap them:
such as the code here:
Not all keyboard scancodes are trapped such as keypad-5 and ctrl-keypad-5 and using _keyhit can trap them:
such as the code here:
Code: (Select All)
Do
x = _KeyHit
'If x Then Print "keyhit="; x
If x = 100304 Then Print "left-shift"
If x = 100303 Then Print "right-shift"
If x = 100306 Then Print "left-ctrl"
If x = 100305 Then Print "right-ctrl"
If x = 100308 Then Print "left-alt"
If x = 100307 Then Print "right-alt"
If x = -12 Then Print "keypad-5"
If x = -108 Then Print "ctrl-keypad-5"
x$ = InKey$
If Len(x$) Then
If x$ = Chr$(27) Then End
Print Asc(Right$(x$, 1))
End If
Loop