Enum ModifierKey

    • Enum Constant Detail

      • ALT

        public static final ModifierKey ALT
        Used in combination with the numeric keypad for entering Alt codes, which output special characters;
      • CTRL

        public static final ModifierKey CTRL
        Used for entering keyboard shortcuts.
      • META

        public static final ModifierKey META
        Used for entering keyboard shortcuts.
      • SHIFT

        public static final ModifierKey SHIFT
        Used for capitalizing letters and entering different types of symbols.
    • Method Detail

      • values

        public static ModifierKey[] 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 (ModifierKey c : ModifierKey.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ModifierKey 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,
                                         ModifierKey... 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,
                                         ModifierKey... 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