Interface InputEventGenerator

All Known Implementing Classes:
RobotEventGenerator

interface InputEventGenerator
Understands generation of input events.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    moveMouse(int x, int y)
    Simulates a user moving the mouse pointer to the given coordinates.
    void
    moveMouse(Component c, int x, int y)
    Simulates a user moving the mouse pointer to the given coordinates relative to the given Component.
    void
    pressKey(int keyCode, char keyChar)
    Simulates a user pressing given key.
    void
    pressMouse(int buttons)
    Simulates a user pressing mouse buttons.
    void
    pressMouse(Component c, Point where, int buttons)
    Simulates a user pressing the given mouse buttons on the given Component.
    void
    pressMouse(Point where, int buttons)
    Simulates a user pressing the given mouse buttons on the given coordinates.
    void
    releaseKey(int keyCode)
    Simulates a user releasing the given key.
    void
    releaseMouse(int buttons)
    Releases the given mouse buttons.
    void
    rotateMouseWheel(int amount)
    Rotates the scroll wheel on wheel-equipped mice.
  • Method Details

    • pressMouse

      void pressMouse(int buttons)
      Simulates a user pressing mouse buttons.
      Parameters:
      buttons - the buttons to press.
    • pressMouse

      void pressMouse(Component c, Point where, int buttons)
      Simulates a user pressing the given mouse buttons on the given Component. If the given component is null, this method will delegate to pressMouse(Point, int).
      Parameters:
      c - the Component to click on.
      where - the given coordinates, relative to the given Component.
      buttons - the mouse buttons to press.
      Throws:
      ActionFailedException - if the component to click is out of the boundaries of the screen.
    • pressMouse

      void pressMouse(Point where, int buttons)
      Simulates a user pressing the given mouse buttons on the given coordinates.
      Parameters:
      where - the coordinates where to press the given mouse buttons.
      buttons - the mouse buttons to press.
    • moveMouse

      void moveMouse(Component c, int x, int y)
      Simulates a user moving the mouse pointer to the given coordinates relative to the given Component.
      Parameters:
      c - the given Component.
      x - X coordinate, relative to the given Component.
      y - Y coordinate, relative to the given Component.
    • moveMouse

      void moveMouse(int x, int y)
      Simulates a user moving the mouse pointer to the given coordinates.
      Parameters:
      x - X coordinate.
      y - Y coordinate.
    • releaseMouse

      void releaseMouse(int buttons)
      Releases the given mouse buttons.
      Parameters:
      buttons - the mouse buttons to release.
    • rotateMouseWheel

      void rotateMouseWheel(int amount)
      Rotates the scroll wheel on wheel-equipped mice.
      Parameters:
      amount - number of "notches" to move the mouse wheel. Negative values indicate movement up/away from the user, while positive values indicate movement down/towards the user.
    • pressKey

      void pressKey(int keyCode, char keyChar)
      Simulates a user pressing given key.
      Parameters:
      keyCode - the code of the key to press.
      keyChar - the given character.
      Throws:
      IllegalArgumentException - if the key code is not valid.
      See Also:
    • releaseKey

      void releaseKey(int keyCode)
      Simulates a user releasing the given key.
      Parameters:
      keyCode - the code of the key to release.
      See Also: