I think i understand what you mean...try this
@test
Cls
B=button(2)
if b and 16 then print "A"
Vsync 1
Goto @test
Also if this isn't what your looking for then just make another loop thats the same but change the variable of button. So instead of b make it something else like c
Prevent Repeating Buttons
Root / Programming Questions / [.]
TovicalCreated:
Sorry, terrible noob question, but how do I make button presses register only once? I found BREPEAT, but I must be badly misunderstanding how it works.
BREPEAT 4 WHILE 1 IF BUTTON(3) AND #A THEN PRINT "A" WENDThen, when I run it and press A the screen fills with A all the way down the screen. Edit: Okay, I just realized how I'm using BREPEAT is just turning the feature off. Still, my questions about how to make a button press only register once remains, because I don't feel like setting time constraints on a button press is the right way to do it...
VSYNC pauses the program for a set amount of frames. If a number after VSYNC is omitted it will just wait 1 frame, what most programs usually wait in a loop. Omitting a VSYNC in a loop like yours would turn the one button input into a lot, because the program is running extremely fast. Putting the VSYNC allows the program to pause an unnoticeable amount, yet let things like button inputs only happen once.
Thank you! That did what I needed; now I just need to compare the two sets of code to see why yours worked and mine didn't, so I can understand the language better xDYeah, anytime