title: Catch LeaveFullscreen in JavaFx
body: <p>I'm writing an JavaFx-Application and want to force the fullscreen. I tried</p>
  
  <pre><code>mainView.getLayout().setOnKeyPressed(event -&gt; {
          if(event.getCode() == KeyCode.ESCAPE){
          mainView.getStage().setFullScreen(true);
          }
      });
  </code></pre>
  
  <p><code>mainView.getLayout()</code> returns a StackPane</p>
  
  <p>but that's not a clean solution, when it leaves the fullscreen it automatically switches back to fullscreen. But I want to Catch the LeaveFullScreen and do nothing instead of leave and switch back. </p>