Skip to content

Commit

Permalink
Fixed spacing.
Browse files Browse the repository at this point in the history
  • Loading branch information
BHamrick1 committed Jan 10, 2017
1 parent 630b198 commit 3ff4434
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions src/robotjs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,38 +244,38 @@ NAN_METHOD(setMouseDelay)
NAN_METHOD(scrollMouse)
{
if (info.Length() != 2)
{
return Nan::ThrowError("Invalid number of arguments.");
}
{
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 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 3ff4434

Please sign in to comment.