KeyboardAPI
VitaLite keyboard input API backed by focused RuneLite canvas dispatch.
ClassRLPlugins API
public class KeyboardAPIMembers
Static methods
- booleancanEnterInputDialog()
Checks whether a chatbox input dialogue is waiting for keyboard input.
- KeyboardTimingProfilegetTimingProfile()
Gets the active keyboard timing profile.
- voidhold(KeyCode)
Holds a key until a later explicit release.
- booleanholdUntil(KeyCode, BooleanSupplier, long)
Holds a key until a condition is true or a timeout expires.
- booleanisHeld(KeyCode)
Checks whether the API currently considers a key held.
- voidpress(KeyCode)
Dispatches KEY_PRESSED for a key and records it as held after dispatch succeeds.
- voidrelease(KeyCode)
Dispatches KEY_RELEASED for a key and clears held state.
- voidreleaseAll()
Releases every key currently held by this API.
- voidsetTimingProfile(KeyboardTimingProfile)
Sets the keyboard timing profile.
- voidsetWordsPerMinute(double)
Sets typing speed while preserving the active profile's other timing values.
- voidtap(KeyCode)
Presses and releases a key with a sampled hold delay.
- voidtypeChar(char)
Types one printable character through its physical key and typed event.
- voidtypeInputDialogValue(int)
Enters an integer into the active chatbox numeric input dialogue.
- voidtypeKey(KeyCode)
Types a key by pressing it, optionally dispatching KEY_TYPED, and releasing it.
- voidtypeKeyImmediate(KeyCode)
Types one key immediately on the client thread without a timed hold.
- inttypeText(CharSequence)
Types text without pressing Enter at the end.
- inttypeText(CharSequence, boolean)
Types text and optionally presses Enter at the end.
- inttypeText(CharSequence, boolean, BooleanSupplier)
Types text until all characters are completed or the stop condition becomes true.
canEnterInputDialog()static
public static boolean canEnterInputDialog()Checks whether a chatbox input dialogue is waiting for keyboard input.
Returns
True when the compact or full chatbox input widget is open.
getTimingProfile()static
public static KeyboardTimingProfile getTimingProfile()Gets the active keyboard timing profile.
Returns
Timing profile.
hold(KeyCode)static
public static void hold(KeyCode keyCode)Holds a key until a later explicit release.
Parameters
keyCode- Key to hold.
holdUntil(KeyCode, BooleanSupplier, long)static
public static boolean holdUntil(KeyCode keyCode, BooleanSupplier condition, long timeoutMs)Holds a key until a condition is true or a timeout expires.
Parameters
keyCode- Key to hold.
condition- Release condition.
timeoutMs- Maximum hold duration in milliseconds.
Returns
True when the condition was met before timeout.
isHeld(KeyCode)static
public static boolean isHeld(KeyCode keyCode)Checks whether the API currently considers a key held.
Parameters
keyCode- Key to inspect.
Returns
True when held.
press(KeyCode)static
public static void press(KeyCode keyCode)Dispatches KEY_PRESSED for a key and records it as held after dispatch succeeds.
Parameters
keyCode- Key to press.
release(KeyCode)static
public static void release(KeyCode keyCode)Dispatches KEY_RELEASED for a key and clears held state.
Parameters
keyCode- Key to release.
releaseAll()static
public static void releaseAll()Releases every key currently held by this API.
setTimingProfile(KeyboardTimingProfile)static
public static void setTimingProfile(KeyboardTimingProfile profile)Sets the keyboard timing profile.
Parameters
profile- Immutable timing profile.
setWordsPerMinute(double)static
public static void setWordsPerMinute(double wordsPerMinute)Sets typing speed while preserving the active profile's other timing values.
Parameters
wordsPerMinute- Words per minute.
tap(KeyCode)static
public static void tap(KeyCode keyCode)Presses and releases a key with a sampled hold delay.
Parameters
keyCode- Key to tap.
typeChar(char)static
public static void typeChar(char character)Types one printable character through its physical key and typed event.
Parameters
character- Character to type.
typeInputDialogValue(int)static
public static void typeInputDialogValue(int value)Enters an integer into the active chatbox numeric input dialogue.
Parameters
value- Value to enter.
typeKey(KeyCode)static
public static void typeKey(KeyCode keyCode)Types a key by pressing it, optionally dispatching KEY_TYPED, and releasing it.
Parameters
keyCode- Key to type.
typeKeyImmediate(KeyCode)static
public static void typeKeyImmediate(KeyCode keyCode)Types one key immediately on the client thread without a timed hold.
Intended for tick-owned UI commands. Timed typing retains its existing behavior.
Parameters
keyCode- Key to type.
typeText(CharSequence)static
public static int typeText(CharSequence text)Types text without pressing Enter at the end.
Parameters
text- Text to type.
Returns
Count of intended characters completed.
typeText(CharSequence, boolean)static
public static int typeText(CharSequence text, boolean pressEnter)Types text and optionally presses Enter at the end.
Parameters
text- Text to type.
pressEnter- True to tap Enter after typing the text.
Returns
Count of intended characters completed.
typeText(CharSequence, boolean, BooleanSupplier)static
public static int typeText(CharSequence text, boolean pressEnter, BooleanSupplier stopCondition)Types text until all characters are completed or the stop condition becomes true.
Parameters
text- Text to type.
pressEnter- True to tap Enter after completing the text.
stopCondition- Stops typing before the next intended character when true.
Returns
Count of intended characters completed.
Also allowed
Every class has these, as in plain Java.
equals, toString