We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What command should I use to make my program pause until the user presses a key?
#1
Hello everyone,

I'm new on this Forum and also new to programming...

I'm trying to code a test to assess the ability to concentrate (https://smallbasic.com/program/?RKCP997.000) but I'm encountering a problem.
This is how it should work:
A letter appears on the screen for 0.5 seconds then it disappears.
You have to memorize it.
Then 4 random letters appear and you must press as quickly as possible on the "Left" key if the original letter is absent and on the "Right" key if it is present.

So far my code works.

But this test should be repeated for 2 minutes, and at the end the number of errors and the average reaction time should be displayed.
But when I make a loop (lines 13 and 38 in my program), the program loops without waiting for the user to press LEFT or RIGHT.
What command should I use to make it pause until the user presses a key?

Thanks for your help ! Smile
[-] The following 1 user Likes Elzaimer's post:
  • Nonki Takahashi
Reply


Messages In This Thread
What command should I use to make my program pause until the user presses a key? - by Elzaimer - 06-24-2024, 09:18 AM

Forum Jump:


Users browsing this thread: 6 Guest(s)