-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changes to get unit tests passing, see #1570
- Loading branch information
1 parent
014658a
commit b2506ab
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
* @author Jonathan Olson <[email protected]> | ||
*/ | ||
|
||
import { EnglishKey, hotkeyManager, scenery } from '../imports.js'; | ||
import { EnglishKey, EnglishStringToCodeMap, hotkeyManager, scenery } from '../imports.js'; | ||
import optionize from '../../../phet-core/js/optionize.js'; | ||
import EnabledComponent, { EnabledComponentOptions } from '../../../axon/js/EnabledComponent.js'; | ||
import TProperty from '../../../axon/js/TProperty.js'; | ||
|
@@ -158,6 +158,11 @@ export default class Hotkey extends EnabledComponent { | |
|
||
this.keys = _.uniq( [ this.key, ...this.modifierKeys ] ); | ||
|
||
// Make sure that every key has an entry in the EnglishStringToCodeMap | ||
for ( const key of this.keys ) { | ||
assert && assert( EnglishStringToCodeMap[ key ], `No codes for this key exists, do you need to add it to EnglishStringToCodeMap?: ${key}` ); | ||
} | ||
|
||
// Create a timer to handle the optional fire-on-hold feature. | ||
if ( this.fireOnHold && this.fireOnHoldTiming === 'custom' ) { | ||
this.fireOnHoldTimer = new CallbackTimer( { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters