The default value for all the modifiers in the KeyCodeCombination
constructor is RELEASED
. So your save shortcut matches the key S with Shift released, Alt released, Meta released, and Control either pressed or released (the ANY
value that you specified matches either pressed or released).
If you want this to only match Ctrl+S you should use
public static final KeyCombination saveShortcut = new KeyCodeCombination(KeyCode.S, KeyCombination.CONTROL_DOWN);
Better still is
public static final KeyCombination saveShortcut = new KeyCodeCombination(KeyCode.S, KeyCombination.SHORTCUT_DOWN);
which would match the shortcut key appropriate to the platform (e.g. Ctrl+S on windows and Cmd+S on Mac).