Class KeyboardEvent
- java.lang.Object
-
- org.dreambot.api.input.event.AbstractEvent
-
- org.dreambot.api.input.event.impl.keyboard.KeyboardEvent
-
- All Implemented Interfaces:
java.lang.Runnable
public class KeyboardEvent extends AbstractEvent
Event to handle typing messages on the keyboard Uses the implementation ofKeyboard.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 Summary
Constructors Constructor Description KeyboardEvent(java.lang.String message, boolean enter, Condition stop)KeyboardEvent(Key key, boolean enter, Condition stop)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Conditioncompleted()Condition to determine if this event has completedbooleanequals(java.lang.Object o)Conditionfailed()Condition to determine if this event has failed.KeygetKey()java.lang.ObjectgetKEYBOARD_LOCK()java.lang.StringgetMessage()ConditiongetStop()inthashCode()booleanisCompleted()booleanisEnter()booleanisOutOfTime()voidrun()Runs this keyboard event Adjusts the message by the return value ofKeyboardTypingAlgorithm.handleTyping(String)on each iterative call Will run until the stop condition is met, it's completed, or it times out.voidsetCompleted(boolean completed)voidsetEnter(boolean enter)voidsetKey(Key key)voidsetMessage(java.lang.String message)voidsetOutOfTime(boolean outOfTime)voidsetStop(Condition stop)java.lang.StringtoString()
-
-
-
Method Detail
-
completed
public Condition completed()
Condition to determine if this event has completed- Specified by:
completedin classAbstractEvent- 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:
failedin classAbstractEvent- 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 ofKeyboardTypingAlgorithm.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()
-
getStop
public Condition getStop()
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-