button short press and long press

Hi, Jani,

I think a useful setting for a button would be how long the button press should last for the action to happen. This way we could avoid accidental press of the button by setting the press action to 1 sec, for instance to reset fuel and trip meter. I know the action has a cool off setting, but that means you can’t trigger it again until that time passes.
I hope this could be easily introduced in the app.
If more actions for different press length could be included that would be even better, short press change between odometer, trip meter A, trip meter B, long press reset trip meter.
But a minimum press length should be available to avoid mistakes.

Thank you!

I will support! This is the right thing

I do understand the need for this feature. The reason I’m not super exited to implement is that messing the Trigger-Action system is somewhat difficult in RealDash codebase. But I have noted this and will take a look later.

Maybe add something like a timer … And bind a button event to it …

[quote=cws176 post_id=439 time=1569980256 user_id=54]
[quote=CoTECH post_id=433 time=1569963294 user_id=76]
Maybe add something like a timer … And bind a button event to it …
[/quote]

That is how my trip reset button is in my vehicle. “Hold” button for 2 seconds and it resets the trip mileage… As said before I have many times accidentally tapped the reset button on RD and lost my mileage on long trips… :lol: At least I have a backup on my vehicle dashboard though for now.
[/quote]
so far, temporarily, I have solved this problem by making a program on arduino, a code that can execute and recognize a short press on one button, long, as well as double click! but it takes away memory and cycles from the controller = brakes on the screen. Moviton is shorter.

The correct way to do this, is when sending a button press, send the down at fixed interval like every 100 msec,

this has several advantage.

  1. the receiver end can time and do long press short press, repeat and so on on the device side.
  2. Today , you get one down press code and one up, what if up is missed ( like window up) you are screwed, with this method, this will never happened since there is continuous data stream while down, a bit like how your keyboard works, there is scan code down, repeat and scan code up, with this removed the repeat and send down every 100 msec while active and once release send final up code .

I have window and mirror control and have seen this happen, so was forced to add timeout for every momentary buttons.

I don’t see any use-case to set the tripmeter. I think reset is enough for that.

I just added new feature for the button gauge as ‘Initial Action Delay’. You can use this new setting to adjust some delay before button is considered to be in ‘pressed’ state.

This will be on 1.6.4, hope to get beta out in couple of days.

:astonished: :smiley: cool! Hurrah!

Thank you, the action delay works with the new beta.
There is only a small issue:
I set this delay to 2000ms. I pressed for 2 seconds the button, then it works, but if I don’t remove the finger instantly it continues to do the action on/off/on/off without any further delay. I tried using also the action cooldown in the same menu for the button with 2000ms but it didn’t work.
Am I doing something wrong?

G

I will check that.

I can’t understand in which window I need to set the button delay value? Show how it works!
Thank!

.P.s.
I was able to do it!

https://youtu.be/ll3FKgmu9iY

I would agree with this; Also known as repeat. when repeat stops, you know the button is no longer being pressed. 4D systems does this also;

If you trigger the button from a digital input it dont works if you have set “the action delay” .


T

Hi Yani,

Have not been on the forum for a while, so hope it is all going well for you.

I now see repeat for button, but is does not seem to do anything and does no repeat the hold down frame.

what I really need an this is a big problems, is to repeat a button and send down code until released, this is especially important for button HOLD conditions, as if the up is missed then thing get messed up very bad since the system still thinks the button is pressed, so at least with repeat now the system can time out quickly if the hold position does not continuously repeat.

I was really excited to see this function now in buttons , but it did not work for me, may be I am doing something wrong, please help.

Thanks much,
Mostafa