Class HoldKey
- java.lang.Object
-
- org.dreambot.api.input.event.AbstractEvent
-
- org.dreambot.api.input.event.impl.keyboard.type.AbstractKeyEvent
-
- org.dreambot.api.input.event.impl.keyboard.type.HoldKey
-
- All Implemented Interfaces:
java.lang.Runnable
public class HoldKey extends AbstractKeyEvent
Event to handle holding a key Does not create a new thread on its own, you must put this call inside a thread if you require it to be threaded. Will repeatedly call pressed and typed(if needed) during hold process. This is the current expected behavior for the Windows OS with most implementations of the JVM If you find that is incorrect, please report to a client developer what your OS and JVM is, so we can do more testing. Runs until the release condition is met, it times out, or is forcefully stopped usingKeyboard.markHeld(Key, boolean)
with false Calls a key released event at the end
-
-
Constructor Summary
Constructors Constructor Description HoldKey(char character)
HoldKey(char character, Condition release)
HoldKey(char character, Condition release, long timeout)
HoldKey(Key key)
HoldKey(Key key, Condition release)
HoldKey(Key key, Condition release, long timeout)
HoldKey(Key key, Condition release, long timeout, KeyLocation location)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Condition
completed()
AbstractCondition
used to determine if current event is complete.boolean
equals(java.lang.Object o)
Condition
getRelease()
long
getTimeout()
int
hashCode()
void
run()
void
setRelease(Condition release)
void
setTimeout(long timeout)
java.lang.String
toString()
-
Methods inherited from class org.dreambot.api.input.event.impl.keyboard.type.AbstractKeyEvent
failed, getCharacter, getGenerated, getKey, getLocation, isCompleted, setCharacter, setCompleted, setGenerated, setKey, setLocation
-
-
-
-
Constructor Detail
-
HoldKey
public HoldKey(char character)
-
HoldKey
public HoldKey(char character, Condition release)
-
HoldKey
public HoldKey(char character, Condition release, long timeout)
-
HoldKey
public HoldKey(Key key)
-
HoldKey
public HoldKey(Key key, Condition release, long timeout, KeyLocation location)
-
-
Method Detail
-
completed
public Condition completed()
Description copied from class:AbstractEvent
AbstractCondition
used to determine if current event is complete.- Overrides:
completed
in classAbstractKeyEvent
- Returns:
Condition
used to determine if current event has completed successfully.
-
run
public void run()
-
getRelease
public Condition getRelease()
-
getTimeout
public long getTimeout()
-
setRelease
public void setRelease(Condition release)
-
setTimeout
public void setTimeout(long timeout)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classAbstractKeyEvent
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractKeyEvent
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractKeyEvent
-
-