Commit ab3bedce authored by Martin Slind Hagen's avatar Martin Slind Hagen 🏑 Committed by Hermann Owren Elton
Browse files

Made it possible to exit the application for people unable to use a mouse

parent 7eafb81d
......@@ -6,6 +6,7 @@ import Roots.LoginRoot;
import Roots.SceneRoot;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.input.KeyCode;
import javafx.stage.Stage;
/**
......@@ -50,6 +51,14 @@ public final class ApplicationManager {
SceneRoot root = new LoginRoot();
scene = new Scene(root.getBorderPane(), WIDTH, HEIGHT);
//Sets the escape key to run the closeProgram method
scene.setOnKeyPressed(e -> {
if(e.getCode() == KeyCode.ESCAPE){
closeProgram();
}
});
stage.setScene(scene);
stage.show();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment