Java Code Examples for java.awt.Event#META_MASK

The following examples show how to use java.awt.Event#META_MASK . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PreferencesUser.java    From SikuliX1 with MIT License 5 votes vote down vote up
private int defaultCaptureHotkeyModifiers() {
  int mod = Event.SHIFT_MASK + Event.META_MASK;
  if (!Settings.isMac()) {
    mod = Event.SHIFT_MASK + Event.CTRL_MASK;
  }
  return mod;
}
 
Example 2
Source File: PreferencesUser.java    From SikuliX1 with MIT License 5 votes vote down vote up
private int defaultStopHotkeyModifiers() {
  int mod = Event.SHIFT_MASK + Event.META_MASK;
  if (!Settings.isMac()) {
    mod = Event.SHIFT_MASK + Event.ALT_MASK;
  }
  return mod;
}
 
Example 3
Source File: JavaElementPropertyAccessor.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public String getMenuKey() {
    int menuShortcutKeyMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
    if ((menuShortcutKeyMask & Event.CTRL_MASK) == Event.CTRL_MASK) {
        return "Control";
    }
    if ((menuShortcutKeyMask & Event.META_MASK) == Event.META_MASK) {
        return "Meta";
    }
    return "";
}
 
Example 4
Source File: OSUtils.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public static Keys getMenuKey() {
    int keyMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
    if (keyMask == Event.CTRL_MASK) {
        return Keys.CONTROL;
    }
    if (keyMask == Event.META_MASK) {
        return Keys.META;
    }
    if (keyMask == Event.ALT_MASK) {
        return Keys.ALT;
    }
    throw new WebDriverException("Unable to find the keymask... not control or meta?");
}
 
Example 5
Source File: DisplayablePanel.java    From TrakEM2 with GNU General Public License v3.0 5 votes vote down vote up
public void mousePressed(final MouseEvent me) {
	if (display.isTransforming()) return;
	display.select(d, me.isShiftDown());
	if (me.isPopupTrigger() || (ij.IJ.isMacOSX() && me.isControlDown()) || MouseEvent.BUTTON2 == me.getButton() || 0 != (me.getModifiers() & Event.META_MASK)) {
		display.getPopupMenu().show(DisplayablePanel.this, me.getX(), me.getY());
	}
}
 
Example 6
Source File: Utils.java    From TrakEM2 with GNU General Public License v3.0 4 votes vote down vote up
/** OS-agnostic diagnosis of whether the click was for the contextual popup menu. */
static public final boolean isPopupTrigger(final MouseEvent me) {
	// ImageJ way, in ij.gui.ImageCanvas class, plus an is-windows switch to prevent meta key from poping up for MacOSX
	return (me.isPopupTrigger() && me.getButton() != 0)  || (IJ.isWindows() && 0 != (me.getModifiers() & Event.META_MASK) );
}