Skip to content

Commit

Permalink
factor out usages of key.toLowerCase to use KeyboardUtils methods, ph…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Feb 17, 2021
1 parent 6b6d66e commit 1c427fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/faradays-law/view/MagnetAutoSlideKeyboardListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class MagnetAutoSlideKeyboardListener {

const { mediumSpeed, slowSpeed, fastSpeed } = options;

// map of the auto-slide keys to a speed for each
// {Map.<KeyDef, number>} - map of the auto-slide keys to a speed for each
const keyToSpeedMap = new Map( [
[ KEY_CODE_DIGIT_1, slowSpeed ],
[ KEY_CODE_DIGIT_2, mediumSpeed ],
Expand Down Expand Up @@ -171,7 +171,7 @@ class MagnetAutoSlideKeyboardListener {
keyModified = keyModified || event.domEvent.getModifierState( modifierArg );
} );

const key = event.domEvent.key.toLowerCase();
const key = KeyboardUtils.getKeyDef( event.domEvent );

if ( keyToSpeedMap.has( key ) && !keyModified ) {

Expand Down

0 comments on commit 1c427fe

Please sign in to comment.