Skip to content

Commit 87fe58e

Browse files
committed
Converted mouseClick function.
1 parent c9509bf commit 87fe58e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/robotjs.cc

+5-4
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,15 @@ Handle<Value> getMousePos(const Arguments& args)
4747
return scope.Close(obj);
4848
}
4949

50-
Handle<Value> mouseClick(const Arguments& args)
50+
NAN_METHOD(mouseClick)
5151
{
52-
HandleScope scope;
52+
NanScope();
5353

5454
MMMouseButton button = LEFT_BUTTON;
5555

5656
clickMouse(button);
57-
return scope.Close(String::New("1"));
57+
58+
NanReturnValue(NanNew("1"));
5859
}
5960

6061
/*
@@ -124,7 +125,7 @@ void init(Handle<Object> target)
124125

125126
target->Set(NanNew<String>("typeString"),
126127
NanNew<FunctionTemplate>(typeString)->GetFunction());
127-
128+
128129
}
129130

130131
NODE_MODULE(robotjs, init)

0 commit comments

Comments
 (0)