Class RobotExtensions


  • public class RobotExtensions
    extends java.lang.Object
    The class RobotExtensions.
    • Constructor Summary

      Constructors 
      Constructor Description
      RobotExtensions()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getKeyCode​(char character)
      Gets the key code from the given char.
      static void typeCharacter​(java.awt.Robot robot, char character)
      Types the given char with the given robot.
      static void typeString​(java.awt.Robot robot, java.lang.String input)
      Type the given string with the given robot.
      • Methods inherited from class java.lang.Object

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

      • RobotExtensions

        public RobotExtensions()
    • Method Detail

      • getKeyCode

        public static int getKeyCode​(char character)
                              throws java.lang.IllegalAccessException,
                                     java.lang.NoSuchFieldException
        Gets the key code from the given char.
        Parameters:
        character - the character
        Returns:
        the key code
        Throws:
        java.lang.IllegalAccessException - the illegal access exception
        java.lang.NoSuchFieldException - the no such field exception
      • typeCharacter

        public static void typeCharacter​(java.awt.Robot robot,
                                         char character)
                                  throws java.lang.IllegalAccessException,
                                         java.lang.NoSuchFieldException
        Types the given char with the given robot.
        Parameters:
        robot - the robot
        character - the character
        Throws:
        java.lang.IllegalAccessException - the illegal access exception
        java.lang.NoSuchFieldException - the no such field exception
      • typeString

        public static void typeString​(java.awt.Robot robot,
                                      java.lang.String input)
                               throws java.lang.NoSuchFieldException,
                                      java.lang.IllegalAccessException
        Type the given string with the given robot.
        Parameters:
        robot - the robot
        input - the input
        Throws:
        java.lang.NoSuchFieldException - the no such field exception
        java.lang.IllegalAccessException - the illegal access exception