From 69ce5192d5e453ba6fe1fdb837ce9916ee9258a2 Mon Sep 17 00:00:00 2001 From: Jonathan Olson Date: Wed, 27 Mar 2024 20:25:13 -0600 Subject: [PATCH] Hotkey management prototype, renamed KeyboardDragListener hotkeys setter => setHotkeys(), see https://github.com/phetsims/scenery/issues/1621 --- js/faradays-law/view/MagnetNodeWithField.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/faradays-law/view/MagnetNodeWithField.js b/js/faradays-law/view/MagnetNodeWithField.js index 2bc1df4..2a8c08c 100644 --- a/js/faradays-law/view/MagnetNodeWithField.js +++ b/js/faradays-law/view/MagnetNodeWithField.js @@ -9,7 +9,7 @@ import Dimension2 from '../../../../dot/js/Dimension2.js'; import GrabDragInteraction from '../../../../scenery-phet/js/accessibility/GrabDragInteraction.js'; -import { animatedPanZoomSingleton, DragListener, HighlightFromNode, InteractiveHighlightingNode, KeyboardListener, KeyboardUtils, Node } from '../../../../scenery/js/imports.js'; +import { animatedPanZoomSingleton, DragListener, eventCodeToEnglishString, HighlightFromNode, InteractiveHighlightingNode, KeyboardUtils, Node } from '../../../../scenery/js/imports.js'; import SoundClip from '../../../../tambo/js/sound-generators/SoundClip.js'; import soundManager from '../../../../tambo/js/soundManager.js'; import grabMagnet_mp3 from '../../../sounds/grabMagnet_mp3.js'; @@ -198,7 +198,7 @@ class MagnetNodeWithField extends Node { // needs to fire for all key codes. const cancelAnimationKeyDownListener = { keydown: event => { - const englishEventKey = KeyboardListener.eventCodeToEnglishString( event.domEvent.code ); + const englishEventKey = eventCodeToEnglishString( event.domEvent.code ); const isSlideKey = MagnetAutoSlideKeyboardListener.AUTO_SLIDE_KEYS.includes( englishEventKey ); // Any key press that is not one of the auto-slide keys should stop the animation.