Skip to content

Commit

Permalink
Play correct sound for any key code, see #484
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Apr 15, 2020
1 parent 4fe9cca commit 8ca5cd7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions js/common/view/WaveInterferenceSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,10 @@ class WaveInterferenceSlider extends HSlider {

// Generate a sound once per event from alternative input, but wait for the event to complete so we can know
// the final property value

timer.setTimeout( () => {

if ( event && event.domEvent &&
( event.domEvent.code === 'ArrowRight' && value >= property.range.max - 1E-6 ||
event.domEvent.code === 'ArrowLeft' && value <= property.range.min + 1E-6 )
) {
if ( Math.abs( value - property.value ) <= 1E-6 ) {
sliderBoundaryClickSoundClip.play();
}
else {
Expand Down

0 comments on commit 8ca5cd7

Please sign in to comment.