Browse Source

On windows buttons can now be triggered using `ENTER`.

Fixes #117
pull/127/head
weisj 5 years ago
parent
commit
58c17eaba8
  1. 5
      core/src/main/java/com/github/weisj/darklaf/DarkLaf.java

5
core/src/main/java/com/github/weisj/darklaf/DarkLaf.java

@ -207,6 +207,11 @@ public class DarkLaf extends BasicLookAndFeel {
// (Alloy license problem)
installCutCopyPasteShortcuts(tableInputMap, true);
}
final InputMap buttonInputMap = (InputMap) defaults.get("Button.focusInputMap");
if (buttonInputMap != null && !SystemInfo.isMac) {
buttonInputMap.put(KeyStroke.getKeyStroke("ENTER"), "pressed");
buttonInputMap.put(KeyStroke.getKeyStroke("released ENTER"), "released");
}
}
private void loadThemeDefaults(final UIDefaults defaults) {

Loading…
Cancel
Save