29 lines
572 B
Plaintext
29 lines
572 B
Plaintext
using [java] java.awt::Robot
|
|
using [java] java.awt.event::InputEvent
|
|
using fwt
|
|
using gfx
|
|
|
|
class Main
|
|
{
|
|
public static Void main ()
|
|
{
|
|
button := Button
|
|
{
|
|
text = "click for robot"
|
|
onAction.add |Event e|
|
|
{
|
|
robot := Robot ()
|
|
robot.mouseMove (50, 50) // move to screen point 50, 50
|
|
robot.mousePress (InputEvent.BUTTON1_MASK) // and click mouse
|
|
robot.mouseRelease (InputEvent.BUTTON1_MASK)
|
|
}
|
|
}
|
|
Window
|
|
{
|
|
title = "simulate mouse event"
|
|
size = Size (300, 200)
|
|
button,
|
|
}.open
|
|
}
|
|
}
|