Skip to content

Commit

Permalink
take away TODO and replace with documentation, see #1621
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Apr 1, 2024
1 parent 06f80cd commit 8a7372d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions js/input/Hotkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions js/input/hotkeyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class HotkeyManager {
private englishKeysDown: Set<EnglishKey> = new Set<EnglishKey>();

// 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
Expand Down Expand Up @@ -278,6 +278,7 @@ class HotkeyManager {
this.activeHotkeys.delete( hotkey );
}
}

scenery.register( 'HotkeyManager', HotkeyManager );

const hotkeyManager = new HotkeyManager();
Expand Down

0 comments on commit 8a7372d

Please sign in to comment.