when i minimize my Stage, JavaFX don't fire my KeyPressed Event. How can i listen to the KeyEvent when the Stage is minimized?
Here i call my Stage:
public void start(Stage primaryStage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("Gui.fxml"));
Parent root = fxmlLoader.load();
primaryStage.setTitle("KillSwitch");
primaryStage.setScene(new Scene(root));
primaryStage.getScene().getRoot().requestFocus();
primaryStage.show();
}
And this is the EventHandler:
public void handleKeyInput(javafx.scene.input.KeyEvent event) throws InterruptedException, SerialPortException, IOException {
if (event.getCode() == KeyCode.UP) {
handletriggerButton();
}
}