Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Backspace Key
#9
(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.
Reply


Messages In This Thread
Backspace Key - by 1micha.elok - 04-23-2025, 03:22 AM
RE: Backspace Key - by johnno56 - 04-23-2025, 06:32 AM
RE: Backspace Key - by Marcus - 04-23-2025, 07:56 PM
RE: Backspace Key - by Marcus - 04-24-2025, 01:37 PM
RE: Backspace Key - by 1micha.elok - Yesterday, 12:57 AM
RE: Backspace Key - by johnno56 - Yesterday, 08:58 AM
RE: Backspace Key - by 1micha.elok - Yesterday, 11:37 AM
RE: Backspace Key - by Marcus - Yesterday, 02:01 PM
RE: Backspace Key - by 1micha.elok - Yesterday, 10:53 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)