Skip to content

Commit

Permalink
Accidentally added old scroll code back.
Browse files Browse the repository at this point in the history
  • Loading branch information
BHamrick1 committed Jan 10, 2017
1 parent 3ff4434 commit 6f8d2b6
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions src/robotjs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -247,35 +247,7 @@ NAN_METHOD(scrollMouse)
{
return Nan::ThrowError("Invalid number of arguments.");
}
Nan::HandleScope scope;

//Get the values of magnitude and direction from the arguments list.
int scrollMagnitude = info[0]->Int32Value();
char *s;

Nan::Utf8String sstr(info[1]);
s = *sstr;

MMMouseWheelDirection scrollDirection;

if (strcmp(s, "up") == 0)
{
scrollDirection = DIRECTION_UP;
}
else if (strcmp(s, "down") == 0)
{
scrollDirection = DIRECTION_DOWN;
}
else
{
return Nan::ThrowError("Invalid scroll direction specified.");
}

scrollMouse(scrollMagnitude, scrollDirection);
microsleep(mouseDelay);

info.GetReturnValue().Set(Nan::New(1));


int x = info[0]->Int32Value();
int y = info[1]->Int32Value();

Expand Down

0 comments on commit 6f8d2b6

Please sign in to comment.