当前位置: 首页>>代码示例>>Java>>正文


Java InputEvent.ALT_DOWN_MASK属性代码示例

本文整理汇总了Java中java.awt.event.InputEvent.ALT_DOWN_MASK属性的典型用法代码示例。如果您正苦于以下问题:Java InputEvent.ALT_DOWN_MASK属性的具体用法?Java InputEvent.ALT_DOWN_MASK怎么用?Java InputEvent.ALT_DOWN_MASK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.awt.event.InputEvent的用法示例。


在下文中一共展示了InputEvent.ALT_DOWN_MASK属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fromDisplayString

public static int fromDisplayString(String str) {
	int ret = 0;
	StringTokenizer toks = new StringTokenizer(str);
	while (toks.hasMoreTokens()) {
		String s = toks.nextToken();
		if (s.equals(Strings.get("ctrlMod")))
			ret |= InputEvent.CTRL_DOWN_MASK;
		else if (s.equals(Strings.get("altMod")))
			ret |= InputEvent.ALT_DOWN_MASK;
		else if (s.equals(Strings.get("shiftMod")))
			ret |= InputEvent.SHIFT_DOWN_MASK;
		else if (s.equals(Strings.get("button1Mod")))
			ret |= InputEvent.BUTTON1_DOWN_MASK;
		else if (s.equals(Strings.get("button2Mod")))
			ret |= InputEvent.BUTTON2_DOWN_MASK;
		else if (s.equals(Strings.get("button3Mod")))
			ret |= InputEvent.BUTTON3_DOWN_MASK;
		else
			throw new NumberFormatException("InputEventUtil");
	}
	return ret;
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:22,代码来源:InputEventUtil.java

示例2: getModifiers

/**
     * Converts XEMBED modifiers mask into AWT InputEvent mask
     */
    int getModifiers(int state) {
        int mods = 0;
        if ((state & XEMBED_MODIFIER_SHIFT) != 0) {
            mods |= InputEvent.SHIFT_DOWN_MASK;
        }
        if ((state & XEMBED_MODIFIER_CONTROL) != 0) {
            mods |= InputEvent.CTRL_DOWN_MASK;
        }
        if ((state & XEMBED_MODIFIER_ALT) != 0) {
            mods |= InputEvent.ALT_DOWN_MASK;
        }
        // FIXME: What is super/hyper?
        // FIXME: Experiments show that SUPER is ALT. So what is Alt then?
        if ((state & XEMBED_MODIFIER_SUPER) != 0) {
            mods |= InputEvent.ALT_DOWN_MASK;
        }
//         if ((state & XEMBED_MODIFIER_HYPER) != 0) {
//             mods |= InputEvent.DOWN_MASK;
//         }
        return mods;
    }
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:24,代码来源:XEmbedHelper.java

示例3: fromString

public static int fromString(String str) {
	int ret = 0;
	StringTokenizer toks = new StringTokenizer(str);
	while (toks.hasMoreTokens()) {
		String s = toks.nextToken();
		if (s.equals(CTRL))
			ret |= InputEvent.CTRL_DOWN_MASK;
		else if (s.equals(SHIFT))
			ret |= InputEvent.SHIFT_DOWN_MASK;
		else if (s.equals(ALT))
			ret |= InputEvent.ALT_DOWN_MASK;
		else if (s.equals(BUTTON1))
			ret |= InputEvent.BUTTON1_DOWN_MASK;
		else if (s.equals(BUTTON2))
			ret |= InputEvent.BUTTON2_DOWN_MASK;
		else if (s.equals(BUTTON3))
			ret |= InputEvent.BUTTON3_DOWN_MASK;
		else
			throw new NumberFormatException("InputEventUtil");
	}
	return ret;
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:22,代码来源:InputEventUtil.java

示例4: toKeyDisplayString

public static String toKeyDisplayString(int mods) {
	ArrayList<String> arr = new ArrayList<String>();
	if ((mods & InputEvent.META_DOWN_MASK) != 0)
		arr.add(Strings.get("metaMod"));
	if ((mods & InputEvent.CTRL_DOWN_MASK) != 0)
		arr.add(Strings.get("ctrlMod"));
	if ((mods & InputEvent.ALT_DOWN_MASK) != 0)
		arr.add(Strings.get("altMod"));
	if ((mods & InputEvent.SHIFT_DOWN_MASK) != 0)
		arr.add(Strings.get("shiftMod"));

	Iterator<String> it = arr.iterator();
	if (it.hasNext()) {
		StringBuilder ret = new StringBuilder();
		ret.append(it.next());
		while (it.hasNext()) {
			ret.append(" ");
			ret.append(it.next());
		}
		return ret.toString();
	} else {
		return "";
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:24,代码来源:InputEventUtil.java

示例5: getModifierEx

public int getModifierEx() {
    int modifiersEx = 0;
    if (isShiftPressed()) {
        modifiersEx |= InputEvent.SHIFT_DOWN_MASK | InputEvent.SHIFT_MASK;
    }
    if (isCtrlPressed()) {
        modifiersEx |= InputEvent.CTRL_DOWN_MASK | InputEvent.CTRL_MASK;
    }
    if (isAltPressed()) {
        modifiersEx |= InputEvent.ALT_DOWN_MASK | InputEvent.ALT_MASK;
    }
    if (isMetaPressed()) {
        modifiersEx |= InputEvent.META_DOWN_MASK | InputEvent.META_MASK;
    }
    return modifiersEx;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:16,代码来源:EventQueueDevice.java

示例6: mapNewModifiers

private static int mapNewModifiers(int modifiers) {
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
        modifiers |= InputEvent.SHIFT_MASK;
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
        modifiers |= InputEvent.ALT_MASK;
    }
    if ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) {
        modifiers |= InputEvent.ALT_GRAPH_MASK;
    }
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
        modifiers |= InputEvent.CTRL_MASK;
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
        modifiers |= InputEvent.META_MASK;
    }

    return modifiers;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:19,代码来源:AWTKeyStroke.java

示例7: mapNewModifiers

@SuppressWarnings("deprecation")
private static int mapNewModifiers(int modifiers) {
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
        modifiers |= InputEvent.SHIFT_MASK;
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
        modifiers |= InputEvent.ALT_MASK;
    }
    if ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) {
        modifiers |= InputEvent.ALT_GRAPH_MASK;
    }
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
        modifiers |= InputEvent.CTRL_MASK;
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
        modifiers |= InputEvent.META_MASK;
    }

    return modifiers;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:AWTKeyStroke.java

示例8: getKeyStrokeAsText

/**
 * Get human-readable name for a {@link KeyStroke}.
 */
public static String getKeyStrokeAsText(@NonNull KeyStroke keyStroke) {
    int modifiers = keyStroke.getModifiers ();
    StringBuilder sb = new StringBuilder ();
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) > 0) {
        sb.append(EMACS_CTRL);
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) > 0) {
        sb.append(STRING_ALT);
    }
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) > 0) {
        sb.append (EMACS_SHIFT);
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) > 0) {
        sb.append(STRING_META);
    }
    if (keyStroke.getKeyCode () != KeyEvent.VK_SHIFT &&
        keyStroke.getKeyCode () != KeyEvent.VK_CONTROL &&
        keyStroke.getKeyCode () != KeyEvent.VK_META &&
        keyStroke.getKeyCode () != KeyEvent.VK_ALT &&
        keyStroke.getKeyCode () != KeyEvent.VK_ALT_GRAPH) {
        sb.append (Utilities.keyToString (
            KeyStroke.getKeyStroke (keyStroke.getKeyCode (), 0)
        ));
    }
    return sb.toString ();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:KeyStrokeUtils.java

示例9: menuKeyReleased

@Override final public void menuKeyReleased(MenuKeyEvent objPmenuKeyEvent) {
	int intLkeysModifiers = objPmenuKeyEvent.getModifiers();
	final int intLaltMask = InputEvent.ALT_DOWN_MASK | InputEvent.ALT_MASK | InputEvent.ALT_GRAPH_MASK | InputEvent.ALT_GRAPH_DOWN_MASK;
	if (Tools.intersects(intLkeysModifiers, intLaltMask)) {
		Tools.debug("Yep !");
		intLkeysModifiers ^= intLaltMask;
		PatternsFileJCheckBoxMenuItem.setKeysModifiers(intLkeysModifiers);
		return;
	}
	PatternsFileJCheckBoxMenuItem.setKeysModifiers(objPmenuKeyEvent.getModifiers());
}
 
开发者ID:jugglemaster,项目名称:JuggleMasterPro,代码行数:11,代码来源:PatternsFileJCheckBoxMenuItem.java

示例10: getKeyStrokeAsText

static String getKeyStrokeAsText (KeyStroke keyStroke) {
    if (keyStroke == null)
        return "";
    int modifiers = keyStroke.getModifiers ();
    StringBuffer sb = new StringBuffer ();
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) > 0)
        sb.append ("Ctrl+");
    if ((modifiers & InputEvent.ALT_DOWN_MASK) > 0)
        sb.append ("Alt+");
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) > 0)
        sb.append ("Shift+");
    if ((modifiers & InputEvent.META_DOWN_MASK) > 0)
        if (Utilities.isMac()) {
            // Mac cloverleaf symbol
            sb.append ("\u2318+");
        } else if (isSolaris()) {
            // Sun meta symbol
            sb.append ("\u25C6+");
        } else {
            sb.append ("Meta+");
        }
    if (keyStroke.getKeyCode () != KeyEvent.VK_SHIFT &&
        keyStroke.getKeyCode () != KeyEvent.VK_CONTROL &&
        keyStroke.getKeyCode () != KeyEvent.VK_META &&
        keyStroke.getKeyCode () != KeyEvent.VK_ALT &&
        keyStroke.getKeyCode () != KeyEvent.VK_ALT_GRAPH
    )
        sb.append (Utilities.keyToString (
            KeyStroke.getKeyStroke (keyStroke.getKeyCode (), 0)
        ));
    return sb.toString ();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:32,代码来源:SearchResultRender.java

示例11: getModifiersText

static String getModifiersText(int modifiers) {
    StringBuilder buf = new StringBuilder();

    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0 ) {
        buf.append("shift ");
    }
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0 ) {
        buf.append("ctrl ");
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) != 0 ) {
        buf.append("meta ");
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0 ) {
        buf.append("alt ");
    }
    if ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0 ) {
        buf.append("altGraph ");
    }
    if ((modifiers & InputEvent.BUTTON1_DOWN_MASK) != 0 ) {
        buf.append("button1 ");
    }
    if ((modifiers & InputEvent.BUTTON2_DOWN_MASK) != 0 ) {
        buf.append("button2 ");
    }
    if ((modifiers & InputEvent.BUTTON3_DOWN_MASK) != 0 ) {
        buf.append("button3 ");
    }

    return buf.toString();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:AWTKeyStroke.java

示例12: getCharSequence

public String getCharSequence(String keys) {
    StringBuilder sb = new StringBuilder();
    if (keys.length() == 1) {
        sb.append(keys);
    } else {
        KeyStrokeParser ksp = new KeyStrokeParser(keys);
        KeyStroke ks = ksp.getKeyStroke();
        CharSequence keys2 = keyMapping.get(ks.getKeyCode());
        if (keys2 == null) {
            String keysText = KeyEvent.getKeyText(ks.getKeyCode());
            if (keysText.length() == 1 && Character.isUpperCase(keysText.charAt(0))) {
                keysText = keysText.toLowerCase();
            }
            keys2 = keysText;
        }
        int modifiers = ks.getModifiers();
        if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
            sb.append(Keys.SHIFT);
        }
        if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
            sb.append(Keys.CONTROL);
        }
        if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
            sb.append(Keys.META);
        }
        if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
            sb.append(Keys.ALT);
        }
        sb.append(keys2);
    }
    return sb.toString();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:32,代码来源:Marathon.java

示例13: inputEventGetModifiersExText

public static String inputEventGetModifiersExText(int modifiers) {
    StringBuffer sb = new StringBuffer();

    if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
        sb.append("Ctrl+");
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
        sb.append("Meta+");
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
        sb.append("Alt+");
    }
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
        sb.append("Shift+");
    }
    if ((modifiers & InputEvent.BUTTON1_DOWN_MASK) != 0) {
        sb.append("Button1+");
    }
    if ((modifiers & InputEvent.BUTTON2_DOWN_MASK) != 0) {
        sb.append("Button2+");
    }
    if ((modifiers & InputEvent.BUTTON3_DOWN_MASK) != 0) {
        sb.append("Button3+");
    }
    String text = sb.toString();
    if (text.equals("")) {
        return text;
    }
    return text.substring(0, text.length() - 1);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:30,代码来源:OSUtils.java

示例14: getKeys

private static CharSequence getKeys(String keysFor, String sKeyStroke) {
    KeyStroke ks = KeyStroke.getKeyStroke(sKeyStroke);
    if (ks == null) {
        throw new WebDriverException("Unable to parse keystroke for " + keysFor + " trying to parse " + sKeyStroke);
    }
    StringBuilder sb = new StringBuilder();
    int modifiers = ks.getModifiers();
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) == InputEvent.CTRL_DOWN_MASK) {
        sb.append(Keys.CONTROL);
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) == InputEvent.ALT_DOWN_MASK) {
        sb.append(Keys.ALT);
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) == InputEvent.META_DOWN_MASK) {
        sb.append(Keys.META);
    }
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) == InputEvent.SHIFT_DOWN_MASK) {
        sb.append(Keys.SHIFT);
    }
    int keyCode = ks.getKeyCode();
    if (keyCode == KeyEvent.VK_UNDEFINED) {
        sb.append(ks.getKeyChar());
    } else {
        sb.append(keyCharFromKeyCode(keyCode, keysFor));
    }
    sb.append(Keys.NULL);
    return sb.toString();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:28,代码来源:OSUtils.java

示例15: mapOldModifiers

private static int mapOldModifiers(int modifiers) {
    if ((modifiers & InputEvent.SHIFT_MASK) != 0) {
        modifiers |= InputEvent.SHIFT_DOWN_MASK;
    }
    if ((modifiers & InputEvent.ALT_MASK) != 0) {
        modifiers |= InputEvent.ALT_DOWN_MASK;
    }
    if ((modifiers & InputEvent.ALT_GRAPH_MASK) != 0) {
        modifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
    }
    if ((modifiers & InputEvent.CTRL_MASK) != 0) {
        modifiers |= InputEvent.CTRL_DOWN_MASK;
    }
    if ((modifiers & InputEvent.META_MASK) != 0) {
        modifiers |= InputEvent.META_DOWN_MASK;
    }

    modifiers &= InputEvent.SHIFT_DOWN_MASK
        | InputEvent.ALT_DOWN_MASK
        | InputEvent.ALT_GRAPH_DOWN_MASK
        | InputEvent.CTRL_DOWN_MASK
        | InputEvent.META_DOWN_MASK
        | InputEvent.BUTTON1_DOWN_MASK
        | InputEvent.BUTTON2_DOWN_MASK
        | InputEvent.BUTTON3_DOWN_MASK;

    return modifiers;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:28,代码来源:AWTKeyStroke.java


注:本文中的java.awt.event.InputEvent.ALT_DOWN_MASK属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。