Package jexer.event

Class TKeypressEvent


  • public class TKeypressEvent
    extends TInputEvent
    This class encapsulates a keyboard input event.
    • Constructor Detail

      • TKeypressEvent

        public TKeypressEvent​(Backend backend,
                              TKeypress key)
        Public contructor.
        Parameters:
        backend - the backend that generated this event
        key - the TKeypress received
      • TKeypressEvent

        public TKeypressEvent​(Backend backend,
                              boolean isKey,
                              int fnKey,
                              int ch,
                              boolean alt,
                              boolean ctrl,
                              boolean shift)
        Public constructor.
        Parameters:
        backend - the backend that generated this event
        isKey - is true, this is a function key
        fnKey - the function key code (only valid if isKey is true)
        ch - the character (only valid if fnKey is false)
        alt - if true, ALT was pressed with this keystroke
        ctrl - if true, CTRL was pressed with this keystroke
        shift - if true, SHIFT was pressed with this keystroke
      • TKeypressEvent

        public TKeypressEvent​(Backend backend,
                              TKeypress key,
                              boolean alt,
                              boolean ctrl,
                              boolean shift)
        Public constructor.
        Parameters:
        backend - the backend that generated this event
        key - the TKeypress received
        alt - if true, ALT was pressed with this keystroke
        ctrl - if true, CTRL was pressed with this keystroke
        shift - if true, SHIFT was pressed with this keystroke
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object rhs)
        Comparison check. All fields must match to return true.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        rhs - another TKeypressEvent or TKeypress instance
        Returns:
        true if all fields are equal
      • hashCode

        public int hashCode()
        Hashcode uses all fields in equals().
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash
      • toString

        public java.lang.String toString()
        Make human-readable description of this TKeypressEvent.
        Overrides:
        toString in class java.lang.Object
        Returns:
        displayable String
      • getKey

        public TKeypress getKey()
        Get keystroke.
        Returns:
        keystroke
      • dup

        public TKeypressEvent dup()
        Create a duplicate instance.
        Returns:
        duplicate intance