Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
INKEY$ doesn't work with fixed length strings
#22
@justsomeguy

If I had to make a workaround in my code, I'd need to do this...

Code: (Select All)
Type tt
    ' Use 2 bytes to capture 2 byte combinations
    k As String * 2
End Type
Dim As tt t
Do
    _Limit 30
    t.k = Chr$(0) + Chr$(0) ' This line and the MID$() line below clears up the issue. Space bar can now be detected.
    Mid$(t.k, 1, 2) = InKey$
    If t.k <> Chr$(0) + Chr$(0) Then
        Print Mid$(t.k, 1, 1), Mid$(t.k, 2, 1), Asc(Mid$(t.k, 1, 1)), Asc(Mid$(t.k, 2, 1))
    End If
Loop

Pete
Reply


Messages In This Thread
RE: INKEY$ doesn't work with fixed length strings - by Pete - 07-31-2024, 06:50 PM



Users browsing this thread: 1 Guest(s)