04-06-2020 03:31 PM
Is there a way to limit how many times a user can press a control in a certain amount of time? I am not sure how else to describe it other than debouncing.
Basically I have a push button and a flaky mouse that is causing it to register several mouse clicks far enough apart that checking "Lock Panel.." or "limit max instances to 1" does not keep it from triggering multiple times.
04-06-2020 03:41 PM
If you are using an Event structure, you should be able build a little logic into the "Value Changed" Case for the push-button. For example, suppose it is Switch when Pushed, Switch when Released, or Switch while Pressed (I'm not sure those are the "official" names), you could put a 10 msec (or even 1 msec) "Wait" in the Case, which should handle any "Transition noise". If it is a latching control, you might want to have a Frame Sequence where you wait first, then read (and reset) the Control (but may it wouldn't matter here ...).
Bob Schor
04-06-2020 04:01 PM
I would replace the mouse. 😄
What is the mechanical action?
Note that each event data node has a time output which is identical to the tick count. Subtract the previous tick and check if at least 1000ms have elapsed to execute the real code, else execute an empty case.
(Lock front panel will not help. Same for max instances=1)
04-06-2020 04:15 PM - edited 04-06-2020 04:16 PM
Here's what I had in mind (the purpose of the init is to ensure that the first click generates a false):
04-06-2020 05:49 PM
Why not replace the mouse? This is by far the best solution by just about any measure. I imagine replacing the mouse is a lot less expensive than you taking the time to think of and implement a software workaround to a hardware issue. For example, just how long did it take for you to muck around with this before you came here? How many solutions are you going to consider before trying a few out? The engineering hours you put into this will probably far outstrip how much money you'll spend on a mouse. Not to mention that replacing the mouse resolves the issue, while coding a workaround merely attempts to hide a problem. It's like "fixing" a pothole by placing a detour sign over it.
If the mouse is really as bad as you say, how do they do ANYthing on that workstation?
07-10-2020 03:54 PM
Use the filter event, compare the time stamp, and discard if time threshold not reached.
07-10-2020 04:15 PM
Wasn't hardware at all...
There were Property Nodes in other cases causing is to appear as double or even triple click.
07-11-2020 06:13 AM
How did you not find that earlier? Was it buried somewhere in some kind of spaghetti code that wasn't made by you?