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

Should I be able to press and hold Step Forward button with keyboard nav? #262

Closed
Nancy-Salpepi opened this issue Jan 23, 2023 · 5 comments

Comments

@Nancy-Salpepi
Copy link

Test device
MacBook Air (m1 chip)

Operating System
13.1

Browser
safari/chrome

Problem description
For phetsims/qa#885, I noticed that if I am using the mouse, I can press and hold the step forward button, but with keyboard nav, pressing the space bar only allows the sim to step forward once.
Pressing and holding the Return(Enter) button, allows for a continuous step forward, but the sound associated with pressing a button is heard repeatedly.

I was wondering if we should be able to continuously step forward by holding down the space bar to be more consistent?

Noting: The current behavior is the same as other published sims with Keyboard Nav and Step Forward (Fourier and Molecules and Light).

Steps to reproduce

  1. On either the Photons or Layer Model Screen, press the Start Sunlight button
  2. Press the pause button using mouse
  3. With your mouse, press and hold the Step Forward button --sim continuously steps forward
  4. Tab to the Step Forward button. Press and hold down the space bar --sim steps forward once
Troubleshooting information: !!!!! DO NOT EDIT !!!!! Name: ‪Greenhouse Effect‬ URL: https://phet-dev.colorado.edu/html/greenhouse-effect/1.1.0-rc.2/phet/greenhouse-effect_all_phet.html Version: 1.1.0-rc.2 2023-01-18 00:39:07 UTC Features missing: applicationcache, applicationcache, touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 Language: en-US Window: 1275x781 Pixel Ratio: 1.7999999523162842/1 WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium) GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 31 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {}
@arouinfar
Copy link
Contributor

Thanks @Nancy-Salpepi. That's a great question. It seems fairly universal that holding return will fire a button continuously, but space will just trigger it once. I also notice that the Basic Actions only include space as an option for pressing buttons, but there are definitely cases where continuous firing is helpful (like the StepForwardButton).

There are likely historic or technical reasons for why things behave this way, but I don't know them. @jessegreenberg?

but the sound associated with pressing a button is heard repeatedly.

I think this is the expected behavior, but @jbphet can confirm.

@jbphet I don't think we need to do anything here from the prototype. It's unclear that we will make any changes, but whatever we do would apply to multiple sims likely requiring a MR. Greenhouse could get patched with the fix then.

@jessegreenberg
Copy link
Contributor

There are likely historic or technical reasons for why things behave this way, but I don't know them. @jessegreenberg?

Yes, the difference comes from the browser/operating system. Most apps will have this difference between enter and spacebar. A while ago we talked about making them behave the same but decided against it because it would be some extra work to go against the convention.

@arouinfar
Copy link
Contributor

Thanks for the explanation @jessegreenberg. Sounds like this is a known and expected behavior. @Nancy-Salpepi should this go in the QA book?

@arouinfar arouinfar assigned Nancy-Salpepi and unassigned arouinfar Jan 23, 2023
@Nancy-Salpepi
Copy link
Author

Sure! I can add something in @arouinfar 🙂

@Nancy-Salpepi Nancy-Salpepi removed their assignment Jan 23, 2023
@jbphet
Copy link
Contributor

jbphet commented Jan 24, 2023

@arouinfar said, based on the previous comments:

Sounds like this is a known and expected behavior.

I think that means there is nothing that needs to be changed in the code. Closing.

@jbphet jbphet closed this as completed Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants