-
- All Known Implementing Classes:
KeyboardRobotImpl
public interface KeyboardRobot
-
-
Method Summary
Modifier and Type Method Description Set<javafx.scene.input.KeyCode>
getPressedKeys()
Gets the keys that have been pressed and not yet released.void
press(javafx.scene.input.KeyCode... keys)
Presses the given keys, until explicitly released viarelease(KeyCode...)
.void
pressNoWait(javafx.scene.input.KeyCode... keys)
Presses the given keys, until explicitly released viarelease(KeyCode...)
.void
release(javafx.scene.input.KeyCode... keys)
Releases the given keys.void
releaseNoWait(javafx.scene.input.KeyCode... keys)
Releases the given keys.
-
-
-
Method Detail
-
press
void press(javafx.scene.input.KeyCode... keys)
Presses the given keys, until explicitly released viarelease(KeyCode...)
. Once pressed,WaitForAsyncUtils.waitForFxEvents()
is called.- Parameters:
keys
- the key codes to press
-
pressNoWait
void pressNoWait(javafx.scene.input.KeyCode... keys)
Presses the given keys, until explicitly released viarelease(KeyCode...)
.WaitForAsyncUtils.waitForFxEvents()
is not called.- Parameters:
keys
- the key codes to press without waiting afterwards
-
getPressedKeys
Set<javafx.scene.input.KeyCode> getPressedKeys()
Gets the keys that have been pressed and not yet released.- Returns:
- an (unmodifiable) containing the keys that have been pressed (but not yet) released.
-
release
void release(javafx.scene.input.KeyCode... keys)
Releases the given keys. Once released,WaitForAsyncUtils.waitForFxEvents()
is called.Note: passing in an empty
KeyCode[]
will release all pressed keys.- Parameters:
keys
- the key codes to release
-
releaseNoWait
void releaseNoWait(javafx.scene.input.KeyCode... keys)
Releases the given keys.WaitForAsyncUtils.waitForFxEvents()
is not called.Note: passing in an empty
KeyCode[]
will release all pressed keys.- Parameters:
keys
- the key codes to release without waiting afterwards
-
-