mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-18 17:34:43 -04:00
uses Command+Key instead of CTRL+Key on a mac, see #302
This commit is contained in:
parent
989b47aba5
commit
6b2b6a7708
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user