Package com.epicbot.api.shared.methods
Interface IKeyboardAPI
public interface IKeyboardAPI
-
Method Summary
Modifier and TypeMethodDescriptionbooleangetKeyState(int keyCode) Gets the key state of the given key.Gets all keys currently pressed down.voidholdKey(int keyCode, int time) Hold a key for an amount of time.voidholdKey(int keyCode, int time, boolean async) Hold a key for an amount of time.voidholdKey(int keyCode, int maxTime, boolean async, Completable completable) Hold a key for a maximum amount of time or until the givenCompletableis done.voidholdKey(int keyCode, int maxTime, Completable completable) Hold a key for a maximum amount of time or until the givenCompletableis done.voidpressKey(int keyCode) voidreleaseKey(int keyCode) voidsendKey(int keyCode) Send a key press and release event for the given key.voidsendKey(int keyCode, boolean async) Send a key press and release event for the given key.voidSends key events to type the given text.voidSends key events to type the given text.voidtypeKey(int keyCode)
-
Method Details
-
getKeyState
boolean getKeyState(int keyCode) Gets the key state of the given key.- Parameters:
keyCode- the key code (seeKeyEvent)- Returns:
- true if the key is pressed, false otherwise
-
getPressedKeys
Gets all keys currently pressed down.- Returns:
- list of key codes (see
KeyEvent)
-
sendKey
void sendKey(int keyCode) Send a key press and release event for the given key.- Parameters:
keyCode- the key code (seeKeyEvent)
-
sendKey
void sendKey(int keyCode, boolean async) Send a key press and release event for the given key.- Parameters:
keyCode- the key code (seeKeyEvent)async- whether to wait until the key is sent
-
sendText
Sends key events to type the given text.- Parameters:
text- the text to typepressEnter- true to press the enter key afterwards, false otherwise
-
sendText
Sends key events to type the given text.- Parameters:
text- the text to typepressEnter- true to press the enter key afterwards, false otherwiseasync- whether to wait until all the keys are sent
-
holdKey
void holdKey(int keyCode, int time) Hold a key for an amount of time.- Parameters:
keyCode- the key code (seeKeyEvent)time- the time to hold the key for
-
holdKey
void holdKey(int keyCode, int time, boolean async) Hold a key for an amount of time.- Parameters:
keyCode- the key code (seeKeyEvent)time- the time to hold the key forasync- whether to wait until all the keys are sent
-
pressKey
void pressKey(int keyCode) -
releaseKey
void releaseKey(int keyCode) -
typeKey
void typeKey(int keyCode)
-