java.awt.event.KeyEvent#VK_CAPS_LOCK源码实例Demo

下面列出了java.awt.event.KeyEvent#VK_CAPS_LOCK 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: openjdk-jdk9   文件: WToolkit.java
@Override
public void setLockingKeyState(int key, boolean on) {
    if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
           key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException("invalid key for Toolkit.setLockingKeyState");
    }
    setLockingKeyStateNative(key, on);
}
 
源代码2 项目: jdk8u_jdk   文件: XToolkit.java
@Override
public boolean getLockingKeyState(int key) {
    if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
           key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException("invalid key for Toolkit.getLockingKeyState");
    }
    awtLock();
    try {
        return getModifierState( key );
    } finally {
        awtUnlock();
    }
}
 
源代码3 项目: dragonwell8_jdk   文件: WToolkit.java
@Override
public void setLockingKeyState(int key, boolean on) {
    if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
           key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException("invalid key for Toolkit.setLockingKeyState");
    }
    setLockingKeyStateNative(key, on);
}
 
源代码4 项目: openjdk-jdk9   文件: WToolkit.java
@Override
public boolean getLockingKeyState(int key) {
    if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
           key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException("invalid key for Toolkit.getLockingKeyState");
    }
    return getLockingKeyStateNative(key);
}
 
源代码5 项目: ghidra   文件: ReservedKeyBindings.java
public static boolean isReservedKeystroke(KeyStroke keyStroke) {
	int code = keyStroke.getKeyCode();
	if (code == KeyEvent.VK_SHIFT || code == KeyEvent.VK_ALT || code == KeyEvent.VK_CONTROL ||
		code == KeyEvent.VK_CAPS_LOCK || code == KeyEvent.VK_TAB ||
		HELP_KEY1.equals(keyStroke) || HELP_KEY2.equals(keyStroke) ||
		HELP_INFO_KEY.equals(keyStroke) || UPDATE_KEY_BINDINGS_KEY.equals(keyStroke) ||
		FOCUS_INFO_KEY.equals(keyStroke) || FOCUS_CYCLE_INFO_KEY.equals(keyStroke)) {
		return true;
	}

	return false;
}
 
源代码6 项目: TencentKona-8   文件: LWCToolkit.java
@Override
public boolean getLockingKeyState(int keyCode) throws UnsupportedOperationException {
    switch (keyCode) {
        case KeyEvent.VK_NUM_LOCK:
        case KeyEvent.VK_SCROLL_LOCK:
        case KeyEvent.VK_KANA_LOCK:
            throw new UnsupportedOperationException("Toolkit.getLockingKeyState");

        case KeyEvent.VK_CAPS_LOCK:
            return isCapsLockOn();

        default:
            throw new IllegalArgumentException("invalid key for Toolkit.getLockingKeyState");
    }
}
 
源代码7 项目: TencentKona-8   文件: WToolkit.java
@Override
public boolean getLockingKeyState(int key) {
    if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
           key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException("invalid key for Toolkit.getLockingKeyState");
    }
    return getLockingKeyStateNative(key);
}
 
源代码8 项目: jdk8u-jdk   文件: WToolkit.java
@Override
public boolean getLockingKeyState(int key) {
    if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
           key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException("invalid key for Toolkit.getLockingKeyState");
    }
    return getLockingKeyStateNative(key);
}
 
源代码9 项目: openjdk-8-source   文件: WToolkit.java
public boolean getLockingKeyState(int key) {
    if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
           key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException("invalid key for Toolkit.getLockingKeyState");
    }
    return getLockingKeyStateNative(key);
}
 
源代码10 项目: jdk8u-dev-jdk   文件: WToolkit.java
@Override
public boolean getLockingKeyState(int key) {
    if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
           key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException("invalid key for Toolkit.getLockingKeyState");
    }
    return getLockingKeyStateNative(key);
}
 
源代码11 项目: jdk8u60   文件: WToolkit.java
@Override
public boolean getLockingKeyState(int key) {
    if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
           key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException("invalid key for Toolkit.getLockingKeyState");
    }
    return getLockingKeyStateNative(key);
}
 
源代码12 项目: wpcleaner   文件: ShortcutOptionsPanel.java
/**
 * Action triggered when keyboard is used.
 * 
 * @param e Event.
 * @return True if processing should end.
 * @see java.awt.KeyEventDispatcher#dispatchKeyEvent(java.awt.event.KeyEvent)
 */
@Override
public boolean dispatchKeyEvent(KeyEvent e) {
  int key = e.getKeyCode();
  if ((key == KeyEvent.VK_ALT) ||
      (key == KeyEvent.VK_ALT_GRAPH) ||
      (key == KeyEvent.VK_BACK_SPACE) ||
      (key == KeyEvent.VK_BEGIN) ||
      (key == KeyEvent.VK_CANCEL) ||
      (key == KeyEvent.VK_CAPS_LOCK) ||
      (key == KeyEvent.VK_CONTROL) ||
      (key == KeyEvent.VK_DELETE) ||
      (key == KeyEvent.VK_DOWN) ||
      (key == KeyEvent.VK_END) ||
      (key == KeyEvent.VK_ENTER) ||
      (key == KeyEvent.VK_LEFT) ||
      (key == KeyEvent.VK_PAGE_DOWN) ||
      (key == KeyEvent.VK_PAGE_UP) ||
      (key == KeyEvent.VK_RIGHT) ||
      (key == KeyEvent.VK_SHIFT) ||
      (key == KeyEvent.VK_TAB) ||
      (key == KeyEvent.VK_UP) ||
      (key == KeyEvent.VK_SHIFT)) {
    return false;
  }
  if (key != KeyEvent.VK_ESCAPE) {
    setKeyCode(key);
  }
  showNotice(false);
  KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(this);
  return false;
}
 
源代码13 项目: Repeat   文件: Config.java
public Config(MainBackEndHolder backEnd) {
	this.backEnd = backEnd;
	useTrayIcon = DEFAULT_TRAY_ICON_USE;
	this.enabledHaltingKeyPressed = true;
	this.executeOnKeyReleased = true;
	this.nativeHookDebugLevel = DEFAULT_NATIVE_HOOK_DEBUG_LEVEL;

	this.mouseGestureActivationKey = KeyEvent.VK_CAPS_LOCK;
	RECORD = new KeyChain(KeyEvent.VK_F9);
	REPLAY = new KeyChain(KeyEvent.VK_F11);
	COMPILED_REPLAY = new KeyChain(KeyEvent.VK_F12);
}
 
源代码14 项目: openjdk-8   文件: WToolkit.java
public void setLockingKeyState(int key, boolean on) {
    if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
           key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException("invalid key for Toolkit.setLockingKeyState");
    }
    setLockingKeyStateNative(key, on);
}
 
源代码15 项目: jdk8u-jdk   文件: WToolkit.java
@Override
public void setLockingKeyState(int key, boolean on) {
    if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
           key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException("invalid key for Toolkit.setLockingKeyState");
    }
    setLockingKeyStateNative(key, on);
}
 
源代码16 项目: openjdk-8-source   文件: WToolkit.java
public void setLockingKeyState(int key, boolean on) {
    if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
           key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException("invalid key for Toolkit.setLockingKeyState");
    }
    setLockingKeyStateNative(key, on);
}
 
源代码17 项目: openjdk-8-source   文件: XToolkit.java
@Override
public boolean getLockingKeyState(int key) {
    if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
           key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException("invalid key for Toolkit.getLockingKeyState");
    }
    awtLock();
    try {
        return getModifierState( key );
    } finally {
        awtUnlock();
    }
}
 
源代码18 项目: jdk8u-jdk   文件: XToolkit.java
@Override
public boolean getLockingKeyState(int key) {
    if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
           key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException("invalid key for Toolkit.getLockingKeyState");
    }
    awtLock();
    try {
        return getModifierState( key );
    } finally {
        awtUnlock();
    }
}
 
源代码19 项目: hottub   文件: LWCToolkit.java
@Override
public boolean getLockingKeyState(int keyCode) throws UnsupportedOperationException {
    switch (keyCode) {
        case KeyEvent.VK_NUM_LOCK:
        case KeyEvent.VK_SCROLL_LOCK:
        case KeyEvent.VK_KANA_LOCK:
            throw new UnsupportedOperationException("Toolkit.getLockingKeyState");

        case KeyEvent.VK_CAPS_LOCK:
            return isCapsLockOn();

        default:
            throw new IllegalArgumentException("invalid key for Toolkit.getLockingKeyState");
    }
}
 
源代码20 项目: Bytecoder   文件: Toolkit.java
/**
 * Sets the state of the given locking key on the keyboard.
 * Valid key codes are
 * {@link java.awt.event.KeyEvent#VK_CAPS_LOCK VK_CAPS_LOCK},
 * {@link java.awt.event.KeyEvent#VK_NUM_LOCK VK_NUM_LOCK},
 * {@link java.awt.event.KeyEvent#VK_SCROLL_LOCK VK_SCROLL_LOCK}, and
 * {@link java.awt.event.KeyEvent#VK_KANA_LOCK VK_KANA_LOCK}.
 * <p>
 * Depending on the platform, setting the state of a locking key may
 * involve event processing and therefore may not be immediately
 * observable through getLockingKeyState.
 *
 * @param  keyCode the key code
 * @param  on the state of the key
 * @exception java.lang.IllegalArgumentException if {@code keyCode}
 * is not one of the valid key codes
 * @exception java.lang.UnsupportedOperationException if the host system doesn't
 * allow setting the state of this key programmatically, or if the keyboard
 * doesn't have this key
 * @exception HeadlessException if GraphicsEnvironment.isHeadless()
 * returns true
 * @see       java.awt.GraphicsEnvironment#isHeadless
 * @since 1.3
 */
public void setLockingKeyState(int keyCode, boolean on)
    throws UnsupportedOperationException
{
    GraphicsEnvironment.checkHeadless();

    if (! (keyCode == KeyEvent.VK_CAPS_LOCK || keyCode == KeyEvent.VK_NUM_LOCK ||
           keyCode == KeyEvent.VK_SCROLL_LOCK || keyCode == KeyEvent.VK_KANA_LOCK)) {
        throw new IllegalArgumentException("invalid key for Toolkit.setLockingKeyState");
    }
    throw new UnsupportedOperationException("Toolkit.setLockingKeyState");
}