Interface IKeyboard


public interface IKeyboard
Provides keyboard input simulation functionality.

This interface allows sending keyboard input to the game client, including typing characters, strings, numbers, and special keys. Input is dispatched as AWT KeyEvents to the game canvas.

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Sends the Enter key press.
    default void
    Sends the Space key press.
    void
    type(char c)
    Types a single character.
    default void
    type(int number)
    Types a number as a string.
    default void
    type(String text)
    Types a string of text without pressing Enter.
    default void
    type(String text, boolean sendEnter)
    Types a string of text with optional Enter key at the end.
  • Method Details

    • type

      void type(char c)
      Types a single character.

      This dispatches KEY_PRESSED, KEY_TYPED, and KEY_RELEASED events to simulate a complete key press cycle.

      Parameters:
      c - the character to type
    • type

      default void type(String text, boolean sendEnter)
      Types a string of text with optional Enter key at the end.
      Parameters:
      text - the text to type
      sendEnter - true to press Enter after typing the text
    • type

      default void type(int number)
      Types a number as a string.

      The number is converted to a string and each digit is typed individually.

      Parameters:
      number - the number to type
    • type

      default void type(String text)
      Types a string of text without pressing Enter.
      Parameters:
      text - the text to type
    • sendEnter

      default void sendEnter()
      Sends the Enter key press.

      Useful for confirming dialog inputs or chat messages.

    • sendSpace

      default void sendSpace()
      Sends the Space key press.

      Useful for continuing dialogues or other space-activated actions.