Skip to content

Commit

Permalink
don't need to explicitly include numpad keys anymore, see phetsims/sc…
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Jul 19, 2023
1 parent f72cf3e commit 654cf82
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion js/keypad/Key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { KeyIDValue } from './KeyID.js';
type SelfOptions = {
horizontalSpan?: number;
verticalSpan?: number;
keyboardIdentifiers?: OneKeyStroke[ ];
keyboardIdentifiers?: OneKeyStroke[];
};

export type KeyOptions = SelfOptions;
Expand Down
26 changes: 13 additions & 13 deletions js/keypad/Keypad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ const DEFAULT_BUTTON_FONT = new PhetFont( { size: 20 } );
const DEFAULT_BUTTON_COLOR = 'white';
const PLUS_CHAR = '\u002b';
const MINUS_CHAR = '\u2212';
const _0 = new Key( '0', KeyID.ZERO, { keyboardIdentifiers: [ '0', 'Numpad0' ] } );
const _1 = new Key( '1', KeyID.ONE, { keyboardIdentifiers: [ '1', 'Numpad1' ] } );
const _2 = new Key( '2', KeyID.TWO, { keyboardIdentifiers: [ '2', 'Numpad2' ] } );
const _3 = new Key( '3', KeyID.THREE, { keyboardIdentifiers: [ '3', 'Numpad3' ] } );
const _4 = new Key( '4', KeyID.FOUR, { keyboardIdentifiers: [ '4', 'Numpad4' ] } );
const _5 = new Key( '5', KeyID.FIVE, { keyboardIdentifiers: [ '5', 'Numpad5' ] } );
const _6 = new Key( '6', KeyID.SIX, { keyboardIdentifiers: [ '6', 'Numpad6' ] } );
const _7 = new Key( '7', KeyID.SEVEN, { keyboardIdentifiers: [ '7', 'Numpad7' ] } );
const _8 = new Key( '8', KeyID.EIGHT, { keyboardIdentifiers: [ '8', 'Numpad8' ] } );
const _9 = new Key( '9', KeyID.NINE, { keyboardIdentifiers: [ '9', 'Numpad9' ] } );
const WIDE_ZERO = new Key( '0', KeyID.ZERO, { horizontalSpan: 2, keyboardIdentifiers: [ '0', 'Numpad0' ] } );
const DECIMAL = new Key( '.', KeyID.DECIMAL, { keyboardIdentifiers: [ 'period', 'NumpadDecimal' ] } );
const _0 = new Key( '0', KeyID.ZERO, { keyboardIdentifiers: [ '0' ] } );
const _1 = new Key( '1', KeyID.ONE, { keyboardIdentifiers: [ '1' ] } );
const _2 = new Key( '2', KeyID.TWO, { keyboardIdentifiers: [ '2' ] } );
const _3 = new Key( '3', KeyID.THREE, { keyboardIdentifiers: [ '3' ] } );
const _4 = new Key( '4', KeyID.FOUR, { keyboardIdentifiers: [ '4' ] } );
const _5 = new Key( '5', KeyID.FIVE, { keyboardIdentifiers: [ '5' ] } );
const _6 = new Key( '6', KeyID.SIX, { keyboardIdentifiers: [ '6' ] } );
const _7 = new Key( '7', KeyID.SEVEN, { keyboardIdentifiers: [ '7' ] } );
const _8 = new Key( '8', KeyID.EIGHT, { keyboardIdentifiers: [ '8' ] } );
const _9 = new Key( '9', KeyID.NINE, { keyboardIdentifiers: [ '9' ] } );
const WIDE_ZERO = new Key( '0', KeyID.ZERO, { horizontalSpan: 2, keyboardIdentifiers: [ '0' ] } );
const DECIMAL = new Key( '.', KeyID.DECIMAL, { keyboardIdentifiers: [ 'period' ] } );
const BACKSPACE = new Key( ( new BackspaceIcon( { scale: 1.5 } ) ),
KeyID.BACKSPACE, { keyboardIdentifiers: [ 'backspace' ] } );
const PLUS_MINUS = new Key( `${PLUS_CHAR}/${MINUS_CHAR}`, KeyID.PLUS_MINUS, {
keyboardIdentifiers: [ 'minus', 'plus', 'NumpadSubtract', 'NumpadAdd' ]
keyboardIdentifiers: [ 'minus', 'plus' ]
} );

export type KeypadLayout = ( Key | null )[][];
Expand Down

0 comments on commit 654cf82

Please sign in to comment.