- java.lang.Object
-
- org.testfx.robot.impl.KeyboardRobotImpl
-
- All Implemented Interfaces:
KeyboardRobot
public class KeyboardRobotImpl extends Object implements KeyboardRobot
-
-
Constructor Summary
Constructors Constructor Description KeyboardRobotImpl(BaseRobot baseRobot)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<KeyCode>getPressedKeys()Gets the keys that have been pressed and not yet released.voidpress(KeyCode... keys)Presses the given keys, until explicitly released viaKeyboardRobot.release(KeyCode...).voidpressNoWait(KeyCode... keys)Presses the given keys, until explicitly released viaKeyboardRobot.release(KeyCode...).voidrelease(KeyCode... keys)Releases the given keys.voidreleaseNoWait(KeyCode... keys)Releases the given keys.
-
-
-
Constructor Detail
-
KeyboardRobotImpl
public KeyboardRobotImpl(BaseRobot baseRobot)
-
-
Method Detail
-
press
public void press(KeyCode... keys)
Description copied from interface:KeyboardRobotPresses the given keys, until explicitly released viaKeyboardRobot.release(KeyCode...). Once pressed,WaitForAsyncUtils.waitForFxEvents()is called.- Specified by:
pressin interfaceKeyboardRobot- Parameters:
keys- the key codes to press
-
pressNoWait
public void pressNoWait(KeyCode... keys)
Description copied from interface:KeyboardRobotPresses the given keys, until explicitly released viaKeyboardRobot.release(KeyCode...).WaitForAsyncUtils.waitForFxEvents()is not called.- Specified by:
pressNoWaitin interfaceKeyboardRobot- Parameters:
keys- the key codes to press without waiting afterwards
-
release
public void release(KeyCode... keys)
Description copied from interface:KeyboardRobotReleases the given keys. Once released,WaitForAsyncUtils.waitForFxEvents()is called.Note: passing in an empty
KeyCode[]will release all pressed keys.- Specified by:
releasein interfaceKeyboardRobot- Parameters:
keys- the key codes to release
-
releaseNoWait
public void releaseNoWait(KeyCode... keys)
Description copied from interface:KeyboardRobotReleases the given keys.WaitForAsyncUtils.waitForFxEvents()is not called.Note: passing in an empty
KeyCode[]will release all pressed keys.- Specified by:
releaseNoWaitin interfaceKeyboardRobot- Parameters:
keys- the key codes to release without waiting afterwards
-
getPressedKeys
public final Set<KeyCode> getPressedKeys()
Description copied from interface:KeyboardRobotGets the keys that have been pressed and not yet released.- Specified by:
getPressedKeysin interfaceKeyboardRobot- Returns:
- an (unmodifiable) containing the keys that have been pressed (but not yet) released.
-
-