Yesterday, 10:53 PM
(Yesterday, 02:01 PM)Marcus Wrote: ...
Code:...
while not keydown(KEY_RETURN)
blinkTimer = (blinkTimer + 1)%60
c = inkey()
while c
if key(charFilter, c) inputString = inputString + chr(c)
elseif c = 8 inputString = left(inputString, len(inputString) - 1)
c = inkey()
wend
...
if blinkTimer%60 < 30 write "_"
...
wend
...
Thank you for the example on how to use `inkey()`. It’s been a huge help on my journey to building a typing tutor—or maybe something even bigger, like a fantasy computer written in Naalaa. I especially appreciate the part with the blinking cursor using `if blinkTimer%60 < 30 then write "_"`. That’s exactly what I needed to simulate an old-school computer cursor.
Next, I’m working on detecting how many times the user presses the backspace key, so I can accurately track their typing. The goal is to count how correctly they type a given sentence and then provide feedback at the end of the session.