diff --git a/js/input/Hotkey.ts b/js/input/Hotkey.ts index fff57e341..8af79d262 100644 --- a/js/input/Hotkey.ts +++ b/js/input/Hotkey.ts @@ -39,6 +39,8 @@ type SelfOptions = { // It is a PhET-specific concept that allows other non-modifier keys to be used as modifiers. // The standard modifier keys (ctrl/alt/meta/shift) are automatically handled by the hotkey system, but this can // expand the set of modifier keys that can be used. + // When a modifier key is added, pressing it will prevent any other Hotkeys from becoming active. This is how the + // typical modifier keys behave and so that is kept consistent for PhET-specific modifier keys. modifierKeys?: EnglishKey[]; // A set of modifier keys that can be down and the hotkey will still fire. Essentially ignoring the modifier diff --git a/js/input/hotkeyManager.ts b/js/input/hotkeyManager.ts index d8d289440..d850e4509 100644 --- a/js/input/hotkeyManager.ts +++ b/js/input/hotkeyManager.ts @@ -48,8 +48,8 @@ class HotkeyManager { private englishKeysDown: Set = new Set(); // The current set of modifier keys (pressed or not) based on current enabled hotkeys - // TODO: Should we actually only have a set of modifier keys PER main key? https://github.com/phetsims/scenery/issues/1621 - // TODO: e.g. should "b+x" (b being pressed) prevent "y"? https://github.com/phetsims/scenery/issues/1621 + // NOTE: Pressed modifier keys will prevent any other Hotkeys from becoming active. For example if you have a hotkey + // with 'b+x', pressing 'b' will prevent any other hotkeys from becoming active. private modifierKeys: EnglishKey[] = []; // Hotkeys that are actively pressed @@ -278,6 +278,7 @@ class HotkeyManager { this.activeHotkeys.delete( hotkey ); } } + scenery.register( 'HotkeyManager', HotkeyManager ); const hotkeyManager = new HotkeyManager();