@ -114,7 +114,15 @@ public class KeyBindingsController {
anchor . addEventFilter ( KeyEvent . KEY_PRESSED , event - > {
anchor . addEventFilter ( KeyEvent . KEY_PRESSED , event - > {
// if a button was clicked
// if a button was clicked
if ( currentButton ! = null ) {
if ( currentButton ! = null ) {
System . out . println ( "button is clicked" ) ;
// check if a button is already mapped to this key
for ( int i = 1 ; i < lstKey . getItems ( ) . size ( ) ; i + + ) {
Button button = ( Button ) lstKey . getItems ( ) . get ( i ) ;
// update buttons text and remove key binding from command
if ( button . getText ( ) = = event . getCode ( ) . toString ( ) ) {
button . setText ( "" ) ;
newKeyFactory . updateKey ( button . getId ( ) , button . getId ( ) ) ;
}
}
// update text on the button
// update text on the button
currentButton . setText ( event . getCode ( ) . toString ( ) ) ;
currentButton . setText ( event . getCode ( ) . toString ( ) ) ;
// update the control key
// update the control key