phetsims / joist

Joist is the main framework for PhET Interactive Simulations. Joist creates and displays the simulation content, home screen, navigation bar, About dialog, enables switching between tabs, and other framework-related features.
http://scenerystack.org/
MIT License
9 stars 6 forks source link

Customize Voice Sliders are not voicing changes with keyboard interaction #854

Closed terracoda closed 2 years ago

terracoda commented 2 years ago

image

The sliders that control voice Rate and voice Pitch used to voice changes when using keyboard. Now they only voice changes when using mouse input.

Here's a link to the design doc for the Preferences Menu in case it is needed.

Assigning @jessegreenberg. Please re-assign if you are not the responsible dev.

jessegreenberg commented 2 years ago

Thanks @terracoda. I started to investigate this in https://github.com/phetsims/utterance-queue/issues/90, but this issue is better in joist. Moving comments over here.

Hmm, odd - I notice that if I press the keyboard buttons slowly and wait ~1 second before releasing I do hear the responses. There must be some interruption happening.

@zepumph helped me think through this - There is a custom Property listener in these controls that trigger the Voicingresponses. We should try to use the code in AccessibleValueHandler to trigger voicing. This could also be an opportunity to add Voicing to Slider directly so that we get Voicing from its DragListener for mouse/touch input. voicingOnEndResponse is public from AccessibleValueHandler and is probably a good place to start.

zepumph commented 2 years ago

This issue is blocking friction and RAP releases as far as I know.

jessegreenberg commented 2 years ago

OK, this was done in the above commits. To summarize, I added Voicing to Slid by using voicingOnEndResponse. The hard part was getting it to work with SliderTrack. I had to make valueOnStart an arg for voicingOnEndResponse so that it could be used without a references to Slider or a subtype of AccessibleValueHandler.

After these changes I updated the sliders in VoicingPanelSection.

@zepumph can you please review these changes to AccessibleValueHandler, Slider, SliderTrack, and VoicingPanelSection?

zepumph commented 2 years ago

This all looks excellent! Thank you so much.