Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Chr$(135) and _Keyhit
#5
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:

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
Reply


Messages In This Thread
Chr$(135) and _Keyhit - by Pete - 01-13-2025, 07:59 AM
RE: Chr$(135) and _Keyhit - by DSMan195276 - 01-13-2025, 08:26 AM
RE: Chr$(135) and _Keyhit - by SMcNeill - 01-13-2025, 02:17 PM
RE: Chr$(135) and _Keyhit - by SMcNeill - 01-13-2025, 02:29 PM
RE: Chr$(135) and _Keyhit - by eoredson - 02-06-2025, 05:38 AM



Users browsing this thread: 1 Guest(s)