SWT自动触发鼠标事件,模拟外挂

Point point = shell.getLocation();

Event ev = new Event();              //创建事件

ev.type = SWT.MouseMove;             //鼠标移动

ev.x = point.x + 130;

ev.y = point.y + 55;

shell.getDisplay().post(ev);

ev.type = SWT.MouseDown;

shell.getDisplay().post(ev);

text.setText("http://www.baidu.com");

        ev.type = SWT.MouseMove;

ev.x = point.x + 1150;

ev.y = point.y + 55;

shell.getDisplay().post(ev);

ev.type = SWT.MouseDown;

ev.button = 1;     

shell.getDisplay().post(ev);

ev.type = SWT.MouseUp;

shell.getDisplay().post(ev);

猜你喜欢

转载自blog.csdn.net/qfxsxhfy/article/details/81185645