Enum KeyboardModifierKey

    • Enum Constant Detail

      • ALT_GRAPH

        public static final KeyboardModifierKey ALT_GRAPH
        The AltGr or AltGraph (Alternate Graphics) key. Enables the ISO Level 3 shift modifier (where Shift is the level 2 modifier).
      • CAPS_LOCK

        public static final KeyboardModifierKey CAPS_LOCK
        The Caps Lock key. Toggles the capital character lock on and off for subsequent input.
      • CONTROL

        public static final KeyboardModifierKey CONTROL
        The Control, Ctrl, or Ctl key. Allows typing control characters.
      • META

        public static final KeyboardModifierKey META
        The Meta key. Allows issuing special command inputs.
      • NUM_LOCK

        public static final KeyboardModifierKey NUM_LOCK
        The NumLock (Number Lock) key. Toggles the numeric keypad between number entry some other mode (often directional arrows).
      • SCROLL_LOCK

        public static final KeyboardModifierKey SCROLL_LOCK
        The Scroll Lock key. Toggles between scrolling and cursor movement modes.
      • SHIFT

        public static final KeyboardModifierKey SHIFT
        The Shift key. Modifies keystrokes to allow typing upper (or other) case letters, and to support typing punctuation and other special characters.
    • Method Detail

      • values

        public static KeyboardModifierKey[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (KeyboardModifierKey c : KeyboardModifierKey.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static KeyboardModifierKey valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • value

        public String value()
        Description copied from interface: Key
        Returns the name value of property
        Specified by:
        value in interface Key
        Returns:
        the name value of property
      • isPressed

        public boolean isPressed​(HasNativeEvent event)
        Returns true if the modifier key is pressed when the event was emitted.
        Parameters:
        event - instance of event container to be checked
        Returns:
        true if the modifier key is pressed when the event was emitted
      • isPressed

        public boolean isPressed​(NativeBaseEvent event)
        Returns true if the modifier key is pressed when the event was emitted.
        Parameters:
        event - instance of native event to be checked
        Returns:
        true if the modifier key is pressed when the event was emitted
      • arePressed

        public static boolean arePressed​(HasNativeEvent event,
                                         KeyboardModifierKey... keys)
        Returns true if all modifier keys are pressed when the event was emitted.
        Parameters:
        event - instance of event container to be checked
        keys - array of keys to be checked against the event
        Returns:
        true if the modifier key is pressed when the event was emitted
      • arePressed

        public static boolean arePressed​(NativeBaseEvent event,
                                         KeyboardModifierKey... keys)
        Returns true if all modifier keys are pressed when the event was emitted.
        Parameters:
        event - instance of native event to be checked
        keys - array of keys to be checked against the event
        Returns:
        true if the modifier key is pressed when the event was emitted