Package org.dreambot.api.input.keyboard
Class StandardKeyboardAlgorithm
- java.lang.Object
-
- org.dreambot.api.input.keyboard.StandardKeyboardAlgorithm
-
- All Implemented Interfaces:
KeyboardTypingAlgorithm
public class StandardKeyboardAlgorithm extends java.lang.Object implements KeyboardTypingAlgorithm
-
-
Constructor Summary
Constructors Constructor Description StandardKeyboardAlgorithm()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getMistake(char c)
java.lang.String
getRandomCharInString(java.lang.String string)
int
handleTyping(java.lang.String message)
Handles typing of characters Intended use is to type one character at a type, but not a requirement Message will be truncated as per the number of characters typed before being re-called Enter is called separately if message is completed successfullyvoid
pressEnter()
Handles pressing enter, called when the message has been typed successfully if requiredvoid
typeKey(char character)
void
typeKey(Key key)
Handles typing of a singularKey
If you require typing a character that is not in the Key list, the key events are able to send the raw character NOTE - the internal information of the event will not be correct if we do not have the key information for it.
-
-
-
Method Detail
-
handleTyping
public int handleTyping(java.lang.String message)
Description copied from interface:KeyboardTypingAlgorithm
Handles typing of characters Intended use is to type one character at a type, but not a requirement Message will be truncated as per the number of characters typed before being re-called Enter is called separately if message is completed successfully- Specified by:
handleTyping
in interfaceKeyboardTypingAlgorithm
- Parameters:
message
- Message to type, recommended to handle only 1 character (not including shift) before returning- Returns:
- number of keys typed (not including Shift)
-
typeKey
public void typeKey(char character)
-
typeKey
public void typeKey(Key key)
Description copied from interface:KeyboardTypingAlgorithm
Handles typing of a singularKey
If you require typing a character that is not in the Key list, the key events are able to send the raw character NOTE - the internal information of the event will not be correct if we do not have the key information for it.- Specified by:
typeKey
in interfaceKeyboardTypingAlgorithm
-
getMistake
public java.lang.String getMistake(char c)
-
getRandomCharInString
public java.lang.String getRandomCharInString(java.lang.String string)
-
pressEnter
public void pressEnter()
Description copied from interface:KeyboardTypingAlgorithm
Handles pressing enter, called when the message has been typed successfully if required- Specified by:
pressEnter
in interfaceKeyboardTypingAlgorithm
-
-