(07-28-2024, 04:07 PM)SMcNeill Wrote: Works as expected. Try this:Wow, missing out on that porta-potty contract is really eating at you!
...
The issue is you're printing it in an loop. You press "A", it pops up on the screen for a poop, and then the loop just keeps repeating, and it's replaced almost instantly by nothing as it waits for the next keypress to poop up the next key being processed.
Pete
- I'm in with the INKEY$ crowd!
EDIT: @justsomeguy
I don't use a dim as string approach with INKEY$, I noticed this approach makes a null string as CHR$(32) + CHR$(32). That will be problematic if you intend to trap a spacebar press.
Code: (Select All)
Type tt
' Use 2 bytes to capture 2 byte combinations
'k AS STRING ' Works
k As String * 2 ' Does Not work
End Type
Dim As tt t
' Note you cannot detect a spacebar press with this 'Dim as String' approach.
Do
t.k = InKey$
If Len(LTrim$(t.k)) Then
Locate 1, 1
Print "k:"; t.k, Asc(Mid$(t.k, 1, 1)), Asc(Mid$(t.k, 2, 1)); " "; ' Cover up larger output strings.
End If
Loop