|
Smells like a debounce issue. Try having a debounce for validating the key press, a timer for the long press and a minumim timer (under debounce) for the pause between the clicks to validate the double click. Maybe add a down time (under debounce) to reset the entire state machine.
GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
It's not a debounce issue, and I already debounce. It's a logic issue. The double click or long press each work by themselves, but no matter what when I try to combine the two (which use two different pseudo-"timers") it horks it up one way or another.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Maybe you simply forgot to clear the other timer when one of the two events fires? When the double click is validated, long click should be zeroed too, and viceversa. And if managed by a state machine it shold return to the starting position until a change in input happens (to not have a looooooooong click registering as multiple events).
Sorry if I suggest things you already done, I'm tackling the same way I would do if I had the same issue.
GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
I didn't break it out to a state machine ... yet. I was hoping to avoid that. It is a matter of not clearing the right things when or otherwise two things interfering. The original one works except click and double click both fire on double click. *sob*. fixing that seems easy, but fixing it breaks everything else. I'll get it eventually.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Click and double click *always* fire together on a double click, even on Windows. I had my share of issues in VB6 to manage a custom control that took click, double click and long (continuous) press. You have to filter them out manually delaying the response to click for a set down time.
GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
Oh yeah, I realize that. I can get click and double click to work fine, until I add long click into the mix, and vice versa.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Have you tried bracing your single-line if-statements?
|
|
|
|
|
in C++ I pretty much always do unless I've forgotten myself.
To err is human. Fortune favors the monsters.
|
|
|
|
|
My gods, the Hell I went through for those.
GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
Sander Rossel wrote: bracing your single-line if
Wow, are you some kind of guru?
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
You know, there is a 'button release' that makes the difference between a double click and a long press.
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
Have you studied your Agrippa?
|
|
|
|
|
Just drag and drop another button. Isn't that obvious?
In a more serious note, I would create easy to change variables for long click duration and double click interval and mindlessly play with changing the values. Mybe the issue is not your logic but the verry tight margins.
There is only one Vera Farmiga and Salma Hayek is her prophet!
Advertise here – minimum three posts per day are guaranteed.
modified 7-Dec-22 13:02pm.
|
|
|
|
|
I finally fixed it but i couldn't tell you exactly how.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Quote: I finally fixed it but i couldn't tell you exactly how.
I don't know what I'm doing, but I'm doing it perfect 
|
|
|
|
|
Who am I to argue with the compiler and the CPU? *shrug*
To err is human. Fortune favors the monsters.
|
|
|
|
|
Wordle 536 5/6
🟨⬛⬛🟨⬛
⬛🟩⬛🟩🟩
⬛🟩⬛🟩🟩
⬛🟩⬛🟩🟩
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 536 6/6
⬜⬜⬜⬜🟨
⬜🟩🟩⬜⬜
⬜🟩🟩⬜⬜
⬜🟩🟩⬜⬜
🟨🟩🟩⬜🟨
🟩🟩🟩🟩🟩
Had never heard this word.
|
|
|
|
|
Wordle 536 3/6
🟨🟨⬜⬜⬜
⬜⬜🟩🟩🟩
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 536 3/6
🟨⬛🟨🟨🟩
⬛🟩🟩🟩🟩
🟩🟩🟩🟩🟩
Uncommon word!
|
|
|
|
|
Wordle 536 3/6
⬜⬜🟨🟩⬜
⬜🟩⬜🟩🟩
🟩🟩🟩🟩🟩
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Wordle 536 4/6
⬛⬛⬛⬛⬛
⬛⬛⬛⬛🟨
⬛🟩🟩⬛🟩
🟩🟩🟩🟩🟩
GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
⬜⬜⬜⬜⬜
⬜⬜🟨🟨🟨
⬜🟨🟨🟨🟨
🟩🟩🟩🟩🟩
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
|
|
|
|
|
Wordle 536 5/6
⬛⬛⬛⬛⬛
🟨🟨⬛⬛⬛
⬛🟩🟩⬛🟩
⬛🟩🟩⬛🟩
🟩🟩🟩🟩🟩
Get me coffee and no one gets hurt!
|
|
|
|
|
Wordle 536 5/6
⬜⬜⬜⬜⬜
⬜⬜🟨⬜⬜
⬜🟩⬜🟩🟩
⬜🟩⬜🟩🟩
🟩🟩🟩🟩🟩
|
|
|
|