Class NativeInputEvent

    • Field Detail

      • SHIFT_L_MASK

        public static final int SHIFT_L_MASK
        The left shift key modifier constant.
        Since:
        2.0
        See Also:
        Constant Field Values
      • CTRL_L_MASK

        public static final int CTRL_L_MASK
        The left ctrl key modifier constant.
        Since:
        2.0
        See Also:
        Constant Field Values
      • META_L_MASK

        public static final int META_L_MASK
        The left meta key modifier constant.
        Since:
        2.0
        See Also:
        Constant Field Values
      • ALT_L_MASK

        public static final int ALT_L_MASK
        The left alt key modifier constant.
        Since:
        2.0
        See Also:
        Constant Field Values
      • SHIFT_R_MASK

        public static final int SHIFT_R_MASK
        The right shift key modifier constant.
        Since:
        2.0
        See Also:
        Constant Field Values
      • CTRL_R_MASK

        public static final int CTRL_R_MASK
        The right ctrl key modifier constant.
        Since:
        2.0
        See Also:
        Constant Field Values
      • META_R_MASK

        public static final int META_R_MASK
        The right meta key modifier constant.
        Since:
        2.0
        See Also:
        Constant Field Values
      • ALT_R_MASK

        public static final int ALT_R_MASK
        The right alt key modifier constant.
        Since:
        2.0
        See Also:
        Constant Field Values
      • SHIFT_MASK

        public static final int SHIFT_MASK
        Either the right or left shift key modifier constant.
        See Also:
        Constant Field Values
      • CTRL_MASK

        public static final int CTRL_MASK
        Either the right or left ctrl key modifier constant.
        See Also:
        Constant Field Values
      • META_MASK

        public static final int META_MASK
        Either the right or left meta key modifier constant.
        See Also:
        Constant Field Values
      • ALT_MASK

        public static final int ALT_MASK
        Either the right or left alt key modifier constant.
        See Also:
        Constant Field Values
      • BUTTON1_MASK

        public static final int BUTTON1_MASK
        The Button1 modifier constant.
        See Also:
        Constant Field Values
      • BUTTON2_MASK

        public static final int BUTTON2_MASK
        The Button2 modifier constant.
        See Also:
        Constant Field Values
      • BUTTON3_MASK

        public static final int BUTTON3_MASK
        The Button3 modifier constant.
        See Also:
        Constant Field Values
      • BUTTON4_MASK

        public static final int BUTTON4_MASK
        The Button4 modifier constant.
        See Also:
        Constant Field Values
      • BUTTON5_MASK

        public static final int BUTTON5_MASK
        The Button5 modifier constant.
        See Also:
        Constant Field Values
      • NUM_LOCK_MASK

        public static final int NUM_LOCK_MASK
        The Number Lock modifier constant.
        See Also:
        Constant Field Values
      • CAPS_LOCK_MASK

        public static final int CAPS_LOCK_MASK
        The Caps Lock modifier constant.
        See Also:
        Constant Field Values
      • SCROLL_LOCK_MASK

        public static final int SCROLL_LOCK_MASK
        The Scroll Lock modifier constant.
        See Also:
        Constant Field Values
    • Constructor Detail

      • NativeInputEvent

        public NativeInputEvent​(Class<GlobalScreen> source,
                                int id,
                                int modifiers)
        Instantiates a new native input event.
        Parameters:
        source - The source of the event.
        id - The type of event.
        modifiers - the modifier keys down during event. NativeInputEvent _MASK modifiers should be used as they are not compatible with the extended _DOWN_MASK or the old _MASK InputEvent modifiers.
    • Method Detail

      • getID

        public int getID()
        Gets the event type.
        Returns:
        the event type
      • getWhen

        public long getWhen()
        Gets the platform dependent native interval for chronological event sequencing.
        Returns:
        the native timestamp
      • getModifiers

        public int getModifiers()
        Gets the modifier flags for this event.
        Returns:
        the modifier flags
      • setModifiers

        public void setModifiers​(int modifiers)
        Deprecated.
        Sets the modifier flags for this event.
        Parameters:
        modifiers - the new modifier flags
      • getModifiersText

        public static String getModifiersText​(int modifiers)
        Gets a String describing the modifier flags, such as "Button1", or "Ctrl+Alt". These strings can be localized by changing the awt.properties file.
        Parameters:
        modifiers - a modifier mask describing the modifier keys and mouse buttons of an event.
        Returns:
        the modifier mask's textual representation.
      • paramString

        public String paramString()
        Gets a String representation of this event. This method is useful for event-logging and debugging.
        Returns:
        a string identifying the event and its attributes