java.lang.Object
is.codion.tools.swing.robot.Controller
Keyboard controller with high-level operations. Delivers input either through a
Robot
(Controller.Transport.ROBOT, realistic OS-level input, for demo recording) or by dispatching events
directly on the event dispatch thread (Controller.Transport.EDT, deterministic and synchronously
confirmed, for reliable programmatic control).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThrown when an input action is attempted when no application window is focused.static enumThe available input transports. -
Method Summary
Modifier and TypeMethodDescriptionvoidautoDelay(int autoDelay) The auto delay of the underlyingRobot, no effect when usingController.Transport.EDT.static Controllerstatic Controllercontroller(Controller.Transport transport) static Controllercontroller(GraphicsDevice device) Processes the given keystroke.Processes the given keystroke.Processes the given keystroke.Processes the given keystroke.voidpause(int milliseconds) Types the given text.Types the given text.voidverifyTimeout(int verifyTimeout)
-
Method Details
-
autoDelay
public void autoDelay(int autoDelay) The auto delay of the underlyingRobot, no effect when usingController.Transport.EDT.- Parameters:
autoDelay- the robot auto delay in ms- See Also:
-
verifyTimeout
public void verifyTimeout(int verifyTimeout) - Parameters:
verifyTimeout- the number of milliseconds to wait for the key event confirming an interaction
-
type
Types the given text.- Parameters:
text- the text to type- Returns:
- the
Interactionverdict for the typed text
-
type
Types the given text.- Parameters:
text- the text to typedescription- the description- Returns:
- the
Interactionverdict for the typed text
-
key
Processes the given keystroke.- Parameters:
keyStroke- the AWT formatted keystroke- Returns:
- the
Interactionverdict for the typed key - Throws:
Controller.FocusLostException- in case application input focus is lost- See Also:
-
key
Processes the given keystroke.- Parameters:
keyStroke- the AWT formatted keystrokerepeat- the number of times to repeat the keystroke- Returns:
- the
Interactionverdict for the typed key - Throws:
Controller.FocusLostException- in case application input focus is lost- See Also:
-
key
Processes the given keystroke.- Parameters:
keyStroke- the AWT formatted keystrokedescription- the description- Returns:
- the
Interactionverdict for the keystroke - Throws:
Controller.FocusLostException- in case application input focus is lost- See Also:
-
key
Processes the given keystroke.- Parameters:
keyStroke- the AWT formatted keystrokerepeat- the number of times to repeat the keystrokedescription- the description- Returns:
- the
Interactionverdict for the keystroke - Throws:
Controller.FocusLostException- in case application input focus is lost- See Also:
-
pause
public void pause(int milliseconds) -
controller
- Returns:
- a
Controllerfor the default screen device
-
controller
- Parameters:
device- the screen device- Returns:
- a
Controllerfor the given screen device, using theController.Transport.ROBOTtransport
-
controller
- Parameters:
transport- the input transport- Returns:
- a
Controllerusing the given transport,Controller.Transport.ROBOTuses the default screen device
-