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

Commit 2a1f3fe

Browse files
author
Jacob van Mourik
committed
Use toolkit to get modifier for duplicate shortcut.
1 parent 8698fb8 commit 2a1f3fe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/jvms/i18neditor/DuplicateTranslationMenuItem.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.jvms.i18neditor;
22

3+
import java.awt.Toolkit;
4+
35
import javax.swing.JMenuItem;
46
import javax.swing.KeyStroke;
57

@@ -15,7 +17,7 @@ public class DuplicateTranslationMenuItem extends JMenuItem {
1517

1618
public DuplicateTranslationMenuItem(Editor editor, boolean enabled) {
1719
super(MessageBundle.get("menu.edit.duplicate.title"));
18-
setAccelerator(KeyStroke.getKeyStroke("ctrl D"));
20+
setAccelerator(KeyStroke.getKeyStroke('D', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
1921
addActionListener(e -> editor.duplicateSelectedTranslation());
2022
setEnabled(enabled);
2123
}

0 commit comments

Comments
 (0)