uses Command+Key instead of CTRL+Key on a mac, see #302

This commit is contained in:
hneemann 2019-08-21 21:47:18 +02:00
parent 989b47aba5
commit 6b2b6a7708

View File

@ -7,6 +7,7 @@ package de.neemann.gui;
import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;
/**
* Action to handle tool tips.
@ -83,7 +84,10 @@ public abstract class ToolTipAction extends AbstractAction {
* @return this for call chaining
*/
public ToolTipAction setAcceleratorCTRLplus(char key) {
return setAccelerator(KeyStroke.getKeyStroke(key, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
int mask = KeyEvent.CTRL_DOWN_MASK;
if (Screen.isMac())
mask= KeyEvent.META_DOWN_MASK;
return setAccelerator(KeyStroke.getKeyStroke(key, mask));
}
/**