0

I am (still) working on my todo application. While I'm thinking about where to place the save button, I figured I would add a keybind to save too.

I added the key bind in my main class like this:

final KeyCombination keyComb1 = new KeyCodeCombination(KeyCode.S,
        KeyCombination.CONTROL_DOWN);
scene.addEventHandler(KeyEvent.KEY_RELEASED, new EventHandler<KeyEvent>() {
    public void handle(KeyEvent event) {
        if (keyComb1.match(event)) {

        }
    }
});

However, the stuff I need to do on the CRL + S is in the controller class. How can I bridge this or make it so the controller can get this information?

Edit: I do not want to pass any info. Just the fact that the event happened.

Edit 2.0: I have solved the issue. The solution was to get the controller instance at the start, save it and when the event was called, use the said method.

Matthew L Parks
  • 17
  • 1
  • 1
  • 10

0 Answers0