From 6d14b48a9c81317bf9855906255fa97c38661d87 Mon Sep 17 00:00:00 2001 From: Jesse Date: Thu, 25 Apr 2024 10:37:04 -0400 Subject: [PATCH] Update usages of KeyboardListener and KeyboardDragListener after changes from https://github.com/phetsims/scenery/issues/1570 --- js/waveGame/view/WaveGameLevelNode.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/js/waveGame/view/WaveGameLevelNode.ts b/js/waveGame/view/WaveGameLevelNode.ts index 7a5ad519..8b3eac62 100644 --- a/js/waveGame/view/WaveGameLevelNode.ts +++ b/js/waveGame/view/WaveGameLevelNode.ts @@ -426,16 +426,10 @@ export default class WaveGameLevelNode extends Node { level.incorrectEmitter.addListener( () => this.incorrectFeedback() ); // Pressing alt+c will check the answer, if the game is in the appropriate state. - const checkAnswerButtonKeyboardListener = new KeyboardListener( { + KeyboardListener.createGlobal( checkAnswerButton, { keys: [ 'alt+c' ], - callback: () => checkAnswerListener(), - - // By making this listener "global" it will fire no matter where focus is in the document as long as - // this Node is visible and has input enabled. Otherwise, the callback will fire only when this Node - // has keyboard focus. - global: true + fire: () => checkAnswerListener() } ); - checkAnswerButton.addInputListener( checkAnswerButtonKeyboardListener ); //------------------------------------------------------------------------------------------------------------------ // PDOM