From 1c427fecada006072ae6db5c006b19da0bd909cf Mon Sep 17 00:00:00 2001 From: zepumph Date: Tue, 16 Feb 2021 19:21:45 -0900 Subject: [PATCH] factor out usages of key.toLowerCase to use KeyboardUtils methods, https://github.com/phetsims/scenery/issues/1053 --- js/faradays-law/view/MagnetAutoSlideKeyboardListener.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/faradays-law/view/MagnetAutoSlideKeyboardListener.js b/js/faradays-law/view/MagnetAutoSlideKeyboardListener.js index 589dfca8..0f8fabd6 100644 --- a/js/faradays-law/view/MagnetAutoSlideKeyboardListener.js +++ b/js/faradays-law/view/MagnetAutoSlideKeyboardListener.js @@ -51,7 +51,7 @@ class MagnetAutoSlideKeyboardListener { const { mediumSpeed, slowSpeed, fastSpeed } = options; - // map of the auto-slide keys to a speed for each + // {Map.} - 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 ], @@ -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 ) {