B4R Question Autorepeating push buttons.

Cableguy

Expert
Licensed User
Longtime User
Can you elaborate on that? What exactly do you want to do? If what you need it to repeat an action while the button is pressed do a " Do While state = True" in the state changed event
 
Upvote 0

tigrot

Well-Known Member
Licensed User
Longtime User
Yes. I need to have a repeated event while a button is pressed. I'm thinking to check in user loop the status of the button, if pressed for a fixed time(repetition delay) start event repetition every n msec(repetion time). If button is released clear everything. So no need for a timer. I'll tell you when I'll test...
Vive la France! (et l'Italie)
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Yes. I need to have a repeated event while a button is pressed. I'm thinking to check in user loop the status of the button, if pressed for a fixed time(repetition delay) start event repetition every n msec(repetion time). If button is released clear everything. So no need for a timer. I'll tell you when I'll test...
Vive la France! (et l'Italie)
So, if I understand right, you and to only trigger the event after X elapsed time (?)
A timer would be a much easier solution to implement and maintain...
Btw , viva Portugal too!
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Thinking of if it would be possible to do without the timer, by using a small loop inside the state changed event, to establish if the delay condition is met and then trigger the action you need
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
You'll get along just fine in English too, just target under 40yo persons when needing directions
 
Upvote 0

tigrot

Well-Known Member
Licensed User
Longtime User
Thinking of if it would be possible to do without the timer, by using a small loop inside the state changed event, to establish if the delay condition is met and then trigger the action you need
My mind is out... I was thinking that B4R allows to write some code in main loop, but I'm not able to find the sub name where to insert my code, like I do with others. You are right better a small timer, 1 for all buttons.
 
Upvote 0
Top