Skip to content

Commit 939518a

Browse files
committed
Sleep after mouse events. #14
1 parent 8081dd1 commit 939518a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/robotjs.cc

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ NAN_METHOD(moveMouse)
3535
MMPoint point;
3636
point = MMPointMake(x, y);
3737
moveMouse(point);
38+
microsleep(10);
39+
3840
NanReturnValue(NanNew("1"));
3941
}
4042

@@ -51,6 +53,8 @@ NAN_METHOD(moveMouseSmooth)
5153
MMPoint point;
5254
point = MMPointMake(x, y);
5355
smoothlyMoveMouse(point);
56+
microsleep(10);
57+
5458
NanReturnValue(NanNew("1"));
5559
}
5660

@@ -100,6 +104,7 @@ NAN_METHOD(mouseClick)
100104
}
101105

102106
clickMouse(button);
107+
microsleep(10);
103108

104109
NanReturnValue(NanNew("1"));
105110
}
@@ -156,6 +161,7 @@ NAN_METHOD(mouseToggle)
156161
}
157162

158163
toggleMouse(down, button);
164+
microsleep(10);
159165

160166
NanReturnValue(NanNew("1"));
161167
}

0 commit comments

Comments
 (0)