From 654cf82fb26202078eb8342da3b89c855527c8bc Mon Sep 17 00:00:00 2001 From: Jesse Date: Wed, 19 Jul 2023 16:31:47 -0400 Subject: [PATCH] don't need to explicitly include numpad keys anymore, see https://github.com/phetsims/scenery/issues/1520 --- js/keypad/Key.ts | 2 +- js/keypad/Keypad.ts | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/js/keypad/Key.ts b/js/keypad/Key.ts index c93c2f2b..8da4af35 100644 --- a/js/keypad/Key.ts +++ b/js/keypad/Key.ts @@ -15,7 +15,7 @@ import { KeyIDValue } from './KeyID.js'; type SelfOptions = { horizontalSpan?: number; verticalSpan?: number; - keyboardIdentifiers?: OneKeyStroke[ ]; + keyboardIdentifiers?: OneKeyStroke[]; }; export type KeyOptions = SelfOptions; diff --git a/js/keypad/Keypad.ts b/js/keypad/Keypad.ts index 82de2e7d..72f99281 100644 --- a/js/keypad/Keypad.ts +++ b/js/keypad/Keypad.ts @@ -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 )[][];