title: KeyEvent to change photos dosen't work, how to activate it?
body: <p>I want to make switching photo program, using imageView and keyEvent, but when I try to use keyEvent it dosen't work, I was trying add scene.getRoot().requestFocus(); but didn't help, so my question is, why it dosen't work any how could I activate it? </p>
  
  <p><strong>MenuScreenController.java</strong></p>
  
  <pre><code>    @FXML
  public void getNewImageHandler(KeyEvent event) {
      System.out.println(singleFile.getName());
      imgFieldView.setOnKeyPressed(e -&gt; {
          if (e.getCode() == KeyCode.N) {
              photoSwipCounter++;
              System.out.println("P clicked");
          } else if (e.getCode() == KeyCode.P) {
              photoSwipCounter--;
          }
      });
  
  //        if (event.getCode().equals(KeyCode.N)) {
  //            photoSwipCounter++;
  //        }
  //        if (event.getCode().equals(KeyCode.P)) {
  //            photoSwipCounter--;
  //        }
  
      if (photoSwipCounter &lt; 0) {
          singleFile = selectedImgsList.get(selectedImgsList.size() - photoSwipCounter);
      } else {
          singleFile = selectedImgsList.get(photoSwipCounter);
      }
  
      image = new Image(singleFile.toURI().toString(),
              900, 400,
              true, true, true);
      imgFieldView.setImage(image);
  }
  </code></pre>
  
  <p>As you can see I was trying many methods, by stream, or classic, but it dosen't make change.</p>
  
  <p><strong>MenuScreen.fxml</strong></p>
  
  <pre><code>&lt;Pane fx:id="menuPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="700.0" prefWidth="1000.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="screensaverfxml.Controllers.MenuScreenController"&gt;
     &lt;children&gt;
        &lt;ImageView fx:id="imgFieldView" fitHeight="400.0" fitWidth="900.0" layoutX="66.0" layoutY="62.0" onKeyPressed="#getNewImageHandler" onMouseClicked="#imgDoubleClick" pickOnBounds="true" preserveRatio="true" /&gt;
     &lt;/children&gt;
  &lt;/Pane&gt;
  </code></pre>
  
  <p><strong>ScreenSaverFXML.java</strong></p>
  
  <pre><code>    @Override
  public void start(Stage primaryStage) throws Exception {
      FXMLLoader loader = new FXMLLoader(this.getClass().getResource("/screensaverfxml/fxmlConfig/MainScreen.fxml"));
      Pane mainPane = loader.load();
      Scene scene = new Scene(mainPane, 1000, 700);
      primaryStage.setScene(scene);
      primaryStage.setTitle("Screen Saver");
  
      primaryStage.show();
  
     scene.getRoot().requestFocus();
  }
  </code></pre>
  
  <p>And ofc I have method to load first photo on imageView and it's work by load it from the folder to the list, but switching to next nope</p>