diff --git a/core/src/main/java/com/github/weisj/darklaf/task/IdeaDefaultsInitTask.java b/core/src/main/java/com/github/weisj/darklaf/task/IdeaDefaultsInitTask.java index 91c5941a2..e11a71a46 100644 --- a/core/src/main/java/com/github/weisj/darklaf/task/IdeaDefaultsInitTask.java +++ b/core/src/main/java/com/github/weisj/darklaf/task/IdeaDefaultsInitTask.java @@ -32,24 +32,55 @@ public void run(final Theme currentTheme, final UIDefaults defaults) { @SuppressWarnings({"HardCodedStringLiteral"}) private void initIdeaDefaults(final UIDefaults defaults) { - defaults.put("Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {"ctrl C", "copy", "meta C", - "copy", "ctrl V", "paste", "meta V", "paste", "ctrl X", "cut", "meta X", "cut", "COPY", "copy", "PASTE", - "paste", "CUT", "cut", "control INSERT", "copy", "shift INSERT", "paste", "shift DELETE", "cut", - "RIGHT", "selectNextColumn", "KP_RIGHT", "selectNextColumn", "LEFT", "selectPreviousColumn", "KP_LEFT", - "selectPreviousColumn", "DOWN", "selectNextRow", "KP_DOWN", "selectNextRow", "UP", "selectPreviousRow", - "KP_UP", "selectPreviousRow", "shift RIGHT", "selectNextColumnExtendSelection", "shift KP_RIGHT", - "selectNextColumnExtendSelection", "shift LEFT", "selectPreviousColumnExtendSelection", "shift KP_LEFT", - "selectPreviousColumnExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "shift KP_DOWN", - "selectNextRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "shift KP_UP", - "selectPreviousRowExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "PAGE_DOWN", - "scrollDownChangeSelection", "HOME", "selectFirstColumn", "END", "selectLastColumn", "shift PAGE_UP", - "scrollUpExtendSelection", "shift PAGE_DOWN", "scrollDownExtendSelection", "shift HOME", - "selectFirstColumnExtendSelection", "shift END", "selectLastColumnExtendSelection", "ctrl PAGE_UP", - "scrollLeftChangeSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "ctrl HOME", - "selectFirstRow", "ctrl END", "selectLastRow", "ctrl shift PAGE_UP", "scrollRightExtendSelection", - "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "ctrl shift HOME", "selectFirstRowExtendSelection", - "ctrl shift END", "selectLastRowExtendSelection", "TAB", "selectNextColumnCell", "shift TAB", - "selectPreviousColumnCell", "ENTER", "selectNextRowCell", "shift ENTER", "selectPreviousRowCell", - "ctrl A", "selectAll", "meta A", "selectAll", "ESCAPE", "cancel", "F2", "startEditing"})); + defaults.put("Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { + "ctrl C", "copy", "meta C", "copy", + "ctrl V", "paste", "meta V", "paste", + "ctrl X", "cut", "meta X", "cut", + "COPY", "copy", + "PASTE", "paste", + "CUT", "cut", + "control INSERT", "copy", + "shift INSERT", "paste", + "shift DELETE", "cut", + "RIGHT", "selectNextColumn", + "KP_RIGHT", "selectNextColumn", + "LEFT", "selectPreviousColumn", + "KP_LEFT", "selectPreviousColumn", + "DOWN", "selectNextRow", + "KP_DOWN", "selectNextRow", + "UP", "selectPreviousRow", + "KP_UP", "selectPreviousRow", + "shift RIGHT", "selectNextColumnExtendSelection", + "shift KP_RIGHT", "selectNextColumnExtendSelection", + "shift LEFT", "selectPreviousColumnExtendSelection", + "shift KP_LEFT", "selectPreviousColumnExtendSelection", + "shift DOWN", "selectNextRowExtendSelection", + "shift KP_DOWN", "selectNextRowExtendSelection", + "shift UP", "selectPreviousRowExtendSelection", + "shift KP_UP", "selectPreviousRowExtendSelection", + "PAGE_UP", "scrollUpChangeSelection", + "PAGE_DOWN", "scrollDownChangeSelection", + "HOME", "selectFirstColumn", + "END", "selectLastColumn", + "shift PAGE_UP", "scrollUpExtendSelection", + "shift PAGE_DOWN", "scrollDownExtendSelection", + "shift HOME", "selectFirstColumnExtendSelection", + "shift END", "selectLastColumnExtendSelection", + "ctrl PAGE_UP", "scrollLeftChangeSelection", "meta PAGE_UP", "scrollLeftChangeSelection", + "ctrl PAGE_DOWN", "scrollRightChangeSelection", "meta PAGE_DOWN", "scrollRightChangeSelection", + "ctrl HOME", "selectFirstRow", "meta HOME", "selectFirstRow", + "ctrl END", "selectLastRow", "meta END", "selectLastRow", + "ctrl shift PAGE_UP", "scrollRightExtendSelection", "meta shift PAGE_UP", "scrollRightExtendSelection", + "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "meta shift PAGE_DOWN", "scrollLeftExtendSelection", + "ctrl shift HOME", "selectFirstRowExtendSelection", "meta shift HOME", "selectFirstRowExtendSelection", + "ctrl shift END", "selectLastRowExtendSelection", "meta shift END", "selectLastRowExtendSelection", + "ctrl A", "selectAll", "meta A", "selectAll", + "TAB", "selectNextColumnCell", + "shift TAB", "selectPreviousColumnCell", + "ENTER", "selectNextRowCell", + "shift ENTER", "selectPreviousRowCell", + "ESCAPE", "cancel", + "F2", "startEditing" + })); } } diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/util/DarkUIUtil.java b/core/src/main/java/com/github/weisj/darklaf/ui/util/DarkUIUtil.java index 8cf2b42c1..ee137cfeb 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/util/DarkUIUtil.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/util/DarkUIUtil.java @@ -39,6 +39,7 @@ import javax.swing.tree.TreeCellEditor; import javax.swing.tree.TreeCellRenderer; +import com.github.weisj.darklaf.platform.SystemInfo; import org.jetbrains.annotations.NotNull; import com.github.weisj.darklaf.focus.FocusParentHelper; @@ -297,7 +298,11 @@ public static boolean isOverText(final MouseEvent e, final int row, final int co } public static boolean isMenuShortcutKeyDown(final InputEvent event) { - return (event.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) != 0; + if (SystemInfo.isMac) { + return (event.getModifiersEx() & InputEvent.META_DOWN_MASK) != 0; + } else { + return (event.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) != 0; + } } @SuppressWarnings("SuspiciousNameCombination")