private void configureRight() { scene.addEventHandler( KeyEvent.KEY_PRESSED, (key) -> { if (key.getCode() == KeyCode.D) { keys.setRight(); } }); scene.addEventHandler( KeyEvent.KEY_RELEASED, (key) -> { if (key.getCode() == KeyCode.D) { keys.releaseRight(); } }); }
private void configureForward() { scene.addEventHandler( KeyEvent.KEY_PRESSED, (key) -> { if (key.getCode() == KeyCode.W) { keys.setSlowForward(); } }); scene.addEventHandler( KeyEvent.KEY_RELEASED, (key) -> { if (key.getCode() == KeyCode.W) { keys.releaseSlowForward(); } }); }