I have to make a system to control access to a group of computers. I need the main screen to be displayed in full screen and cannot be closed, minimized or changed. I have already managed to do the first two. But I don't know how to block the Windows key and the combination alt + tab.
This is the way I am doing it. I don't know if there is a better way.
@Override
public void start(Stage primaryStage) {
try {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(Main.class.getResource("/vista/PantallaBloqueo.fxml"));
Pane ventana = (Pane) loader.load();
Scene escena = new Scene(ventana);
primaryStage.setScene(escena);
primaryStage.setFullScreen(true);
primaryStage.setOnCloseRequest(e -> e.consume());
primaryStage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);
primaryStage.addEventFilter(KeyEvent.KEY_PRESSED, ke -> {
if (ke.getCode() == KeyCode.ALT && ke.isAltDown())
ke.consume();
});
primaryStage.show();
} catch (IOException error) {
System.out.println(error);
}
}
What I need is for this window to override the entire Windows system until users log in.
Thanks :)