Package com.kraken.api.input
Class KeyboardService
- java.lang.Object
-
- com.kraken.api.input.KeyboardService
-
public class KeyboardService extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description KeyboardService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenter()Simulates pressing the Enter key.voidholdShift()Simulates holding the Shift key using a KEY_PRESSED event.voidkeyHold(int key)Simulates holding down a key using a KEY_PRESSED event.voidkeyPress(char key)Simulates pressing a single character using a KEY_TYPED event.voidkeyPress(int key)Simulates pressing and releasing a key in quick succession.voidkeyRelease(int key)Simulates releasing a key using a KEY_RELEASED event.voidreleaseShift()Simulates releasing the Shift key using a KEY_RELEASED event.voidtypeString(java.lang.String word)Types out a string character-by-character using KEY_TYPED events.
-
-
-
Method Detail
-
typeString
public void typeString(java.lang.String word)
Types out a string character-by-character using KEY_TYPED events. Each character is sent with a short randomized delay and sleep between characters.- Parameters:
word- the string to type into the game
-
keyPress
public void keyPress(char key)
Simulates pressing a single character using a KEY_TYPED event.- Parameters:
key- the character to press
-
holdShift
public void holdShift()
Simulates holding the Shift key using a KEY_PRESSED event.
-
releaseShift
public void releaseShift()
Simulates releasing the Shift key using a KEY_RELEASED event.
-
keyHold
public void keyHold(int key)
Simulates holding down a key using a KEY_PRESSED event.- Parameters:
key- the key code fromKeyEvent
-
keyRelease
public void keyRelease(int key)
Simulates releasing a key using a KEY_RELEASED event.- Parameters:
key- the key code fromKeyEvent
-
keyPress
public void keyPress(int key)
Simulates pressing and releasing a key in quick succession.- Parameters:
key- the key code fromKeyEvent
-
enter
public void enter()
Simulates pressing the Enter key. If the player is not logged in, this uses KEY_TYPED to avoid auto-login triggers.
-
-