Class Keyboard
java.lang.Object
org.rspeer.game.Keyboard
Deprecated.
Provides operations related to the Keyboard. Please note that this should only be used when necessary.
In most cases there are better alternatives, such as invoking CS2 via
Game.ScriptExecutor.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDeprecated.Presses the Enter key.static voidpressEventKey(int eventKey) Deprecated.Presses and releases a key specified by its key code.static voidsendKey(char key) Deprecated.Sends a single character as keyboard input.static voidDeprecated.Sends a sequence of characters as keyboard input.
-
Constructor Details
-
Keyboard
public Keyboard()Deprecated.
-
-
Method Details
-
sendText
Deprecated.Sends a sequence of characters as keyboard input.Each character in the provided string is dispatched as a key typed event. Optionally, the Enter key can be pressed after the input.
- Parameters:
text- the text to send as keyboard inputpressEnter-trueto press the Enter key after sending the text,falseotherwise- Throws:
IllegalArgumentException- iftextis null
-
pressEnter
public static void pressEnter()Deprecated.Presses the Enter key.This method dispatches both
KEY_PRESSEDandKEY_RELEASEDevents for the Enter key. -
sendKey
public static void sendKey(char key) Deprecated.Sends a single character as keyboard input.This method dispatches a
KEY_TYPEDevent for the given character.- Parameters:
key- the character to send as input
-
pressEventKey
public static void pressEventKey(int eventKey) Deprecated.Presses and releases a key specified by its key code.This method dispatches both
KEY_PRESSEDandKEY_RELEASEDevents for the specified key code.- Parameters:
eventKey- the key code of the key to press
-