Skip to content

Commit

Permalink
add getNumberFromCode to support number keys, phetsims/scenery#1053
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jul 6, 2021
1 parent 4c176ee commit e4450ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/common/view/BothHandsInteractionListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class BothHandsInteractionListener {

// for number keys 0-9, jump both values to that tick mark number. This value changes based on the tickMarkRangeProperty
for ( let i = 0; i <= 9; i++ ) {
if ( domEvent.key === `${i}` &&
if ( KeyboardUtils.getNumberFromCode( domEvent ) === i &&
!domEvent.getModifierState( 'Control' ) &&
!domEvent.getModifierState( 'Shift' ) &&
!domEvent.getModifierState( 'Alt' ) ) {
Expand Down

0 comments on commit e4450ba

Please sign in to comment.