Skip to content

Commit

Permalink
Converted mouseClick function.
Browse files Browse the repository at this point in the history
  • Loading branch information
octalmage committed Jan 27, 2015
1 parent c9509bf commit 87fe58e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/robotjs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ Handle<Value> getMousePos(const Arguments& args)
return scope.Close(obj);
}

Handle<Value> mouseClick(const Arguments& args)
NAN_METHOD(mouseClick)
{
HandleScope scope;
NanScope();

MMMouseButton button = LEFT_BUTTON;

clickMouse(button);
return scope.Close(String::New("1"));

NanReturnValue(NanNew("1"));
}

/*
Expand Down Expand Up @@ -124,7 +125,7 @@ void init(Handle<Object> target)

target->Set(NanNew<String>("typeString"),
NanNew<FunctionTemplate>(typeString)->GetFunction());

}

NODE_MODULE(robotjs, init)

0 comments on commit 87fe58e

Please sign in to comment.