Class KeyboardRobotImpl

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private BaseRobot baseRobot  
      private static javafx.scene.input.KeyCode OS_SPECIFIC_SHORTCUT
      This key is sent depending on the platform via the Robot to Java.
      private java.util.Set<javafx.scene.input.KeyCode> pressedKeys  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.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 via KeyboardRobot.release(KeyCode...).
      private void pressKey​(javafx.scene.input.KeyCode keyCode)  
      void pressNoWait​(javafx.scene.input.KeyCode... keys)
      Presses the given keys, until explicitly released via KeyboardRobot.release(KeyCode...).
      void release​(javafx.scene.input.KeyCode... keys)
      Releases the given keys.
      private void releaseKey​(javafx.scene.input.KeyCode keyCode)  
      void releaseNoWait​(javafx.scene.input.KeyCode... keys)
      Releases the given keys.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • OS_SPECIFIC_SHORTCUT

        private static final javafx.scene.input.KeyCode OS_SPECIFIC_SHORTCUT
        This key is sent depending on the platform via the Robot to Java.
      • baseRobot

        private final BaseRobot baseRobot
      • pressedKeys

        private final java.util.Set<javafx.scene.input.KeyCode> pressedKeys
    • Constructor Detail

      • KeyboardRobotImpl

        public KeyboardRobotImpl​(BaseRobot baseRobot)
    • Method Detail

      • release

        public void release​(javafx.scene.input.KeyCode... keys)
        Description copied from interface: KeyboardRobot
        Releases the given keys. Once released, WaitForAsyncUtils.waitForFxEvents() is called.

        Note: passing in an empty KeyCode[] will release all pressed keys.

        Specified by:
        release in interface KeyboardRobot
        Parameters:
        keys - the key codes to release
      • releaseNoWait

        public void releaseNoWait​(javafx.scene.input.KeyCode... keys)
        Description copied from interface: KeyboardRobot
        Releases the given keys. WaitForAsyncUtils.waitForFxEvents() is not called.

        Note: passing in an empty KeyCode[] will release all pressed keys.

        Specified by:
        releaseNoWait in interface KeyboardRobot
        Parameters:
        keys - the key codes to release without waiting afterwards
      • getPressedKeys

        public final java.util.Set<javafx.scene.input.KeyCode> getPressedKeys()
        Description copied from interface: KeyboardRobot
        Gets the keys that have been pressed and not yet released.
        Specified by:
        getPressedKeys in interface KeyboardRobot
        Returns:
        an (unmodifiable) containing the keys that have been pressed (but not yet) released.
      • pressKey

        private void pressKey​(javafx.scene.input.KeyCode keyCode)
      • releaseKey

        private void releaseKey​(javafx.scene.input.KeyCode keyCode)