Добавлена обработка курсора от Android-клиента

This commit is contained in:
Victor 2014-03-05 17:35:58 +02:00
parent 76a7955ae1
commit d4d0af8c55

View File

@ -30,6 +30,8 @@ public class CursorOperation extends Operation {
TYPE_RELEASED = 4,
TYPE_KEY_RELEASED = 5,
TYPE_MOVE_RELATIVE = 6,
TYPE_MOUSE_PRESSED = 7,
TYPE_MOUSE_RELEASED = 8,
STOP = 10;
private RobotUtils robot;
@ -97,6 +99,12 @@ public class CursorOperation extends Operation {
int x = (int) (dis.readInt());
int y = (int) (dis.readInt());
robot.moveCursorRelative(x, y);
} else if (type == TYPE_MOUSE_PRESSED) {
int button = dis.readInt();
robot.getRobot().mousePress(button);
} else if (type == TYPE_MOUSE_RELEASED) {
int button = dis.readInt();
robot.getRobot().mouseRelease(button);
} else if (type == TYPE_RELEASED) {
robot.getRobot().mouseRelease(InputEvent.BUTTON1_MASK);
}