google / project-gameface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Avoid double click

euu2021 opened this issue · comments

commented

I'm using a facial gesture to send key presses, but I'm having problems with accidental double click.

In the Android Camera Switches app, by Google, there is an option to ignore repetitive presses. The user can set a time inside the app, so there is like a cooldown between each press.

Please, consider including this feature here, too.

Thanks,

@euu2021 I would like to better understand your issue, reproduce it, and think on ways to solve it. Could you please describe the keybindings that you are using? If I understood correctly, do you perform the gesture and Gameface send two click gestures one after the other?

I gave Switch access on Android a try. The setting mentioned by @euu2021 is "Ignore repeated Camera Switch triggers - Multiple Camera Switch triggers within this time will be treated as one trigger".

commented

I'm using Gameface to operate a flashcard app. So, I spend hours just pressing 2 buttons (space bar or key 1):

flowchart TD
    A[Front of the card 1] -->|Space bar| B(Back of the card 1)
    B -->|Space bar| D[Good]
    B -->|Key 1| E[Bad]
    D --> F[Front of card 2]
    E --> F
    F -->|Space bar| G[...]
Loading

I use one gesture (mouthSmileRight) for Space Bar, and another gesture (Open mouth) for Key 1.

The problem happens when I make the gestures for Space Bar, and it registers twice. For example, if I'm facing the Front of card 1, a double space bar will make the back of the card appears, and, immediately (and undesirably), rate it good, thus making the Front of card 2 appear:

image

Notice that, at any point of the process, sending an unwanted double Space Bar is a problem

commented

And I use a very subtle threshold for detection, which makes it wonderfully comfortable to operate, but it sometimes gives me the double click problem.

In the following example I'm exaggerating by keeping in the verge of a smile (like when you are trying hard to hold a laugh), but it illustrates that, when using a subtle threshold, Gameface shows this Geiger counter behavior:

run_app_CkSVlzhpQG

So, I would like it to have a behavior like: detect green; cooldown for a second; detect green; cooldown for a second. I've been using it for months in Android and it works great.

Thank you for the clear explanation, I understand the issue. As you pointed out, the keybind controller does not have a cooldown between events, but I think I can implement it as an advanced config.

I will give it a try, and update this issue with a PR.

commented

Thank you for the clear explanation, I understand the issue. As you pointed out, the keybind controller does not have a cooldown between events, but I think I can implement it as an advanced config.

I will give it a try, and update this issue with a PR.

Thanks!

commented

I just found another reference that may be useful for inspiration. In EyeCommander, this feature is called Throttle Time:

image