Skip to content

Commit

Permalink
Sleep after mouse events. #14
Browse files Browse the repository at this point in the history
  • Loading branch information
octalmage committed Jul 26, 2015
1 parent 8081dd1 commit 939518a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/robotjs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ NAN_METHOD(moveMouse)
MMPoint point;
point = MMPointMake(x, y);
moveMouse(point);
microsleep(10);

NanReturnValue(NanNew("1"));
}

Expand All @@ -51,6 +53,8 @@ NAN_METHOD(moveMouseSmooth)
MMPoint point;
point = MMPointMake(x, y);
smoothlyMoveMouse(point);
microsleep(10);

NanReturnValue(NanNew("1"));
}

Expand Down Expand Up @@ -100,6 +104,7 @@ NAN_METHOD(mouseClick)
}

clickMouse(button);
microsleep(10);

NanReturnValue(NanNew("1"));
}
Expand Down Expand Up @@ -156,6 +161,7 @@ NAN_METHOD(mouseToggle)
}

toggleMouse(down, button);
microsleep(10);

NanReturnValue(NanNew("1"));
}
Expand Down

0 comments on commit 939518a

Please sign in to comment.