Skip to content

Commit

Permalink
some cleanup and documentation, see #1445
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Oct 26, 2022
1 parent f0ac2d5 commit f292b61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
8 changes: 0 additions & 8 deletions js/accessibility/KeyStateTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,6 @@ class KeyStateTracker {
return false;
}

/**
* get the most recent key pressed
*/
public mostRecentKeyFromList( keys: string[] ): string {
assert && assert( this.areKeysDown( keys ), 'Not all the keys in the list are down.' );
return _.minBy( keys, key => this.timeDownForKey( key ) )!;
}

/**
* Returns true if ALL of the keys in the list are currently down. Values of the keyList array are the
* KeyboardEvent.code for the keys you are interested in.
Expand Down
6 changes: 3 additions & 3 deletions js/listeners/KeyboardListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

/**
* A listener for general keyboard input. Specify the keys with a `keys` option in a readable format that looks like
* this: 'shift+t|alt+shift+r'
* this: [ 'shift+t', 'alt+shift+r' ]
*
* - '|' separates different groups of keys
* - '+' separates each key in a single group
* - Each entry in the array represents a "group" of keys.
* - '+' separates each key in a single group.
* - The keys leading up to the last key in the group are considered "modifier" keys. The last key in the group needs
* to be pressed while the modifier keys are down.
* - The order modifier keys are pressed does not matter for firing the callback.
Expand Down

0 comments on commit f292b61

Please sign in to comment.