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 5ab0a10 commit 0f04363
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions js/common/view/WorkspaceNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ class WorkspaceNode extends Node {
accumulatorOptions: {
maxDigits: 3
},
keyboardListenerOptions: {
global: true
}
useGlobalKeyboardListener: true
} );

keypad.stringProperty.link( input => { model.inputProperty.set( input ); } );
Expand Down Expand Up @@ -179,11 +177,10 @@ class WorkspaceNode extends Node {
listener: () => { model.fillEquation(); }
} );

const submitFromKeypadListener = new KeyboardListener( {
KeyboardListener.createGlobal( keypad, {
keys: [ 'space', 'enter' ],
listenerFireTrigger: 'up',
global: true,
callback: () => {
fireOnDown: false,
fire: () => {
if ( keypad.stringProperty.value === '' ) {
return;
}
Expand All @@ -198,8 +195,6 @@ class WorkspaceNode extends Node {
}
} );

keypad.addInputListener( submitFromKeypadListener );

controlPanelVBox.addChild( keypad );
controlPanelVBox.addChild( checkButton );

Expand Down

0 comments on commit 0f04363

Please sign in to comment.