Class Event


  • public class Event
    extends Object
    The Event
    Author:
    Christian Paul
    • Constructor Detail

      • Event

        public Event()
    • Method Detail

      • getType

        public int getType()
        Get the type of the event
        Returns:
        type as Integer
      • getCode

        public int getCode()
        Get the code of the event
        Returns:
        code as Integer
      • getValue

        public int getValue()
        Get the value of the event
        Returns:
        value as Integer
      • getTypeCode

        protected static int getTypeCode​(EventType type,
                                         int code)
        Get the type and code of the event as one value
        Parameters:
        type -
        code -
        Returns:
        typecode
      • getTypeCode

        protected int getTypeCode()
        Get the type and code of the event as one value
        Returns:
        typecode
      • getEventType

        public EventType getEventType()
        Get the type of the event
        Returns:
        type of the event as EventType
      • getSeconds

        public long getSeconds()
        Get the seconds part of the timestamp
        Returns:
        seconds
      • getMicroseconds

        public long getMicroseconds()
        Get the microseconds part of the timestamp
        Returns:
        microseconds
      • getTimestamp

        public Date getTimestamp()
        Get the java timestamp of the event
        Returns:
        timestamp as Date
      • isPressed

        public boolean isPressed()
        Check, if key is pressed.
        Returns:
        true, if key is pressed or value has the value 1
      • isReleased

        public boolean isReleased()
        Check, if key is released.
        Returns:
        true, if key is released or value has the value 0