Skip to content

Commit

Permalink
Update usages of KeyboardListener and KeyboardDragListener after chan…
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Apr 25, 2024
1 parent 8947a06 commit 6d14b48
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions js/waveGame/view/WaveGameLevelNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6d14b48

Please sign in to comment.