/** * Processes the key event pressed. * * @param keyEvent An event which indicates that a keystroke occurred in a component. */ private void processKeyEventPressed(KeyEvent keyEvent) { if (keyEvent.getCode() == KeyCode.CONTROL) { controlPressed = true; } else if (keyEvent.getCode() == KeyCode.Z) { zPressed = true; } else if (keyEvent.getCode() == KeyCode.Y) { yPressed = true; } else if (keyEvent.getCode() == KeyCode.Q) { qPressed = true; } else if (keyEvent.getCode() == KeyCode.F12) { mainApp.showHelpOverview(); } else if (keyEvent.getCode() == KeyCode.F5) { mainApp.showOverdueOverview(); } else if (keyEvent.getCode() == KeyCode.F4) { mainApp.showCompleteOverview(); } else if (keyEvent.getCode() == KeyCode.F3) { mainApp.showUpcomingOverview(); } else if (keyEvent.getCode() == KeyCode.F2) { mainApp.showTodayOverview(); } else if (keyEvent.getCode() == KeyCode.F1) { mainApp.showTaskOverview(); } else if (keyEvent.getCode() == KeyCode.F11) { mainApp.getPrimaryStage().toBack(); } else if (keyEvent.getCode() == KeyCode.ESCAPE) { commandText.setText("home"); onEnter(); } if (controlPressed && zPressed) { commandText.setText("undo"); onEnter(); } if (controlPressed && yPressed) { commandText.setText("redo"); onEnter(); } if (controlPressed && qPressed) { System.exit(0); } }
/** When all tasks tab is clicked, show task overview. */ @FXML void onClickedAllTask() { mainApp.showTaskOverview(); }