Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long hold on kick button leads to multiple clicks #102

Closed
KatieWoe opened this issue Mar 22, 2022 · 8 comments
Closed

Long hold on kick button leads to multiple clicks #102

KatieWoe opened this issue Mar 22, 2022 · 8 comments

Comments

@KatieWoe
Copy link

Test device
Dell
Operating System
Win 11
Browser
Firefox
Problem description
For phetsims/qa#789
If you hold the "Kick 1" button down for a moment, more than one kick will happen, and it will continue after you let go.

Visuals
longclick

Troubleshooting information:

!!!!! DO NOT EDIT !!!!!
Name: ‪Center and Variability‬
URL: https://phet-dev.colorado.edu/html/center-and-variability/1.0.0-rc.1/phet/center-and-variability_all_phet.html
Version: 1.0.0-rc.1 2022-03-21 16:46:53 UTC
Features missing: touch
Flags: pixelRatioScaling
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0
Language: en-US
Window: 1280x667
Pixel Ratio: 1.5/1
WebGL: WebGL 1.0
GLSL: WebGL GLSL ES 1.0
Vendor: Mozilla (ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0))
Vertex: attribs: 16 varying: 30 uniform: 4096
Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32)
Max viewport: 32767x32767
OES_texture_float: true
Dependencies JSON: {}

@KatieWoe KatieWoe added the type:bug Something isn't working label Mar 22, 2022
@amanda-phet
Copy link
Contributor

I think the bug here is that only 5 kicks should have happened in this case, because the mouse was released and kicks continued to occur.

@amanda-phet amanda-phet added this to the Classroom prototype milestone Mar 23, 2022
@KatieWoe
Copy link
Author

Noting that this doesn't seem to happen at all with the "Kick 5" button.

@chrisklus
Copy link
Contributor

@samreid and I thought about a fix for this and came up with two ideas:

  1. Cancel the remaining queued kicks when the user releases holding down the "Kick 1" button.
  2. Match the fire-on-hold rate of the "Kick 1" button to the rate of the multi-kick "release" for when soccer balls are in the queue.

We think 2 will be simplest to try out first.

@samreid
Copy link
Member

samreid commented Mar 28, 2022

We experimented with (2), by changing the kick rate to match the 0.5 second delay (and also accounting for the 0.075 poise time), and it seemed better but still wasn't perfect. By that I mean that you could still sometimes see one more kick right after releasing the button. We weren't sure if that was good enough, so we investigated (1) above. However, the current implementation schedules single and multi-kicks through the same channel, so it would be a lot of increased complexity and work to get it to exactly track whether the kick 1 button is pressed but only for limiting those kicks. We estimate maybe 1-3 hours for the initial implementation if we want to invest in that.

After further investigation, we found that a delay of 650ms seemed to have a very good matchup rate, very few false positives. We'll commit that and see if it is good enough.

samreid added a commit that referenced this issue Mar 28, 2022
@samreid
Copy link
Member

samreid commented Mar 28, 2022

@KatieWoe can you please review the proposal in phettest? If it seems OK, please relabel as "ready for cherry pick".

@KatieWoe
Copy link
Author

I found this behavior much, much better. My only note is that "Kick 5" does not behave the same way, and only fires when you let go. Is this intended?

@chrisklus
Copy link
Contributor

Thanks @KatieWoe! Yes, fire-on-hold is intentionally disabled for "Kick 5".

@samreid
Copy link
Member

samreid commented Apr 6, 2022

@chrisklus and I confirmed this is fixed in in #122, closing.

@samreid samreid closed this as completed Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants