Skip to content
This repository was archived by the owner on Mar 15, 2023. It is now read-only.

Commit 32e5c23

Browse files
author
Jacob van Mourik
committed
Use different key mapping for tree navigation on mac.
1 parent aff553e commit 32e5c23

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/jvms/i18neditor/editor/Editor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import javax.swing.tree.TreePath;
5050

5151
import org.apache.commons.lang3.LocaleUtils;
52+
import org.apache.commons.lang3.SystemUtils;
5253
import org.slf4j.Logger;
5354
import org.slf4j.LoggerFactory;
5455

@@ -700,7 +701,9 @@ public void filesDropped(java.io.File[] files) {
700701

701702
private void setupGlobalKeyEventDispatcher() {
702703
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(e -> {
703-
if (!e.isAltDown() || e.getID() != KeyEvent.KEY_PRESSED) {
704+
if (e.getID() != KeyEvent.KEY_PRESSED || !e.isAltDown() ||
705+
(SystemUtils.IS_OS_MAC && !e.isMetaDown()) ||
706+
(!SystemUtils.IS_OS_MAC && !e.isShiftDown())) {
704707
return false;
705708
}
706709
TreePath selected = translationTree.getSelectionPath();

0 commit comments

Comments
 (0)