Skip to main content
Jtron.11
Senior
October 31, 2025
Solved

Repeat Button Implementation

  • October 31, 2025
  • 1 reply
  • 129 views

Dear all,

Can you please help to point me to any of the repeat button implementation example?

I have successfully implement the single button with plus and minus but the number target is too big and it is taking too many clicks to get to the target number.  I would like to use the repeat button feature to achieve the goal that if the repeat button is holding, the setting will go faster and reach the goal.

Best answer by MM..1

Try search Long press

void Screen3View::handleClickEvent(const ClickEvent& evt)
{
 if(evt.getType()==ClickEvent::PRESSED && flexButton1.getAbsoluteRect().intersect(evt.getX(), evt.getY()))
 {
 evaluate_long_press = 1;
 }
 else if(evt.getType()==ClickEvent::RELEASED)
 {
 evaluate_long_press = 0;
 }
 Screen3ViewBase::handleClickEvent( evt);
}

1 reply

MM..1
MM..1Best answer
Chief III
November 1, 2025

Try search Long press

void Screen3View::handleClickEvent(const ClickEvent& evt)
{
 if(evt.getType()==ClickEvent::PRESSED && flexButton1.getAbsoluteRect().intersect(evt.getX(), evt.getY()))
 {
 evaluate_long_press = 1;
 }
 else if(evt.getType()==ClickEvent::RELEASED)
 {
 evaluate_long_press = 0;
 }
 Screen3ViewBase::handleClickEvent( evt);
}