Class KeyController

java.lang.Object
is.codion.plugin.swing.robot.KeyController

public final class KeyController extends Object
Keyboard controller with high-level operations, based on Robot
  • Method Details

    • setAutoDelay

      public void setAutoDelay(int autoDelay)
      Parameters:
      autoDelay - the robot auto delay
      See Also:
    • type

      public void type(String text)
      Types the given text.
      Parameters:
      text - the text to type
    • type

      public void type(String text, @Nullable String description)
      Types the given text.
      Parameters:
      text - the text to type
      description - the description
    • keyStroke

      public void keyStroke(String keyStroke)
      Processes the given keystroke.
      Parameters:
      keyStroke - the AWT formatted keystroke
    • keyStroke

      public void keyStroke(KeyStroke keyStroke)
      Processes the given keystroke.
      Parameters:
      keyStroke - the keystroke
    • keyStroke

      public void keyStroke(String keyStroke, @Nullable String description)
      Processes the given keystroke.
      Parameters:
      keyStroke - the keystroke
      description - the description
    • keyStroke

      public void keyStroke(KeyStroke keyStroke, @Nullable String description)
      Processes the given keystroke.
      Parameters:
      keyStroke - the keystroke
      description - the description
    • delay

      public void delay(int milliseconds)
    • keyController

      public static KeyController keyController()
      Returns:
      a KeyController for the default screen device
    • keyController

      public static KeyController keyController(GraphicsDevice device)
      Parameters:
      device - the screen device
      Returns:
      a KeyController for the given screen device
    • run

      public static void run(Consumer<KeyController> controller)
      Parameters:
      controller - the controller to use
    • run

      public static void run(Consumer<KeyController> controller, GraphicsDevice device)
      Parameters:
      controller - the controller to use
      device - the screen device