Class KeyboardEvent

  • All Implemented Interfaces:
    java.lang.Runnable

    public class KeyboardEvent
    extends AbstractEvent
    Event to handle typing messages on the keyboard Uses the implementation of Keyboard.getKeyboardTypingAlgorithm() Automatically stops if script is stopped or paused when no random solver is active. Has a built-in timeout of message#length seconds.
    • Constructor Detail

      • KeyboardEvent

        public KeyboardEvent​(java.lang.String message,
                             boolean enter,
                             Condition stop)
      • KeyboardEvent

        public KeyboardEvent​(Key key,
                             boolean enter,
                             Condition stop)
    • Method Detail

      • completed

        public Condition completed()
        Condition to determine if this event has completed
        Specified by:
        completed in class AbstractEvent
        Returns:
        Condition to check if message successfully typed or event is marked as completed
      • failed

        public Condition failed()
        Condition to determine if this event has failed.
        Specified by:
        failed in class AbstractEvent
        Returns:
        Condition for if the stop condition is met or the event has timed out and the message has not yet been completed.
      • run

        public void run()
        Runs this keyboard event Adjusts the message by the return value of KeyboardTypingAlgorithm.handleTyping(String) on each iterative call Will run until the stop condition is met, it's completed, or it times out. Will press enter if the message is typed successfully and enter is set to true
      • getMessage

        public java.lang.String getMessage()
      • getKey

        public Key getKey()
      • isEnter

        public boolean isEnter()
      • isOutOfTime

        public boolean isOutOfTime()
      • isCompleted

        public boolean isCompleted()
      • getKEYBOARD_LOCK

        public java.lang.Object getKEYBOARD_LOCK()
      • setMessage

        public void setMessage​(java.lang.String message)
      • setKey

        public void setKey​(Key key)
      • setEnter

        public void setEnter​(boolean enter)
      • setStop

        public void setStop​(Condition stop)
      • setOutOfTime

        public void setOutOfTime​(boolean outOfTime)
      • setCompleted

        public void setCompleted​(boolean completed)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object