Commit e4ba3c0 1 parent 7f2090d commit e4ba3c0 Copy full SHA for e4ba3c0
File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -28,18 +28,33 @@ Handle<Value> getMousePos(const Arguments& args)
28
28
HandleScope scope;
29
29
30
30
MMPoint pos = getMousePos ();
31
+
32
+ // Return object with .x and .y.
31
33
Local<Object> obj = Object::New ();
32
34
obj->Set (String::NewSymbol (" x" ), Number::New (pos.x ));
33
35
obj->Set (String::NewSymbol (" y" ), Number::New (pos.y ));
34
36
return scope.Close (obj);
35
37
}
36
38
39
+ Handle <Value> mouseClick (const Arguments& args)
40
+ {
41
+ HandleScope scope;
42
+
43
+ MMMouseButton button = LEFT_BUTTON;
44
+
45
+ clickMouse (button);
46
+ return scope.Close (String::New (" 1" ));
47
+ }
48
+
37
49
void init (Handle <Object> target)
38
50
{
39
51
target->Set (String::NewSymbol (" moveMouse" ),
40
52
FunctionTemplate::New (moveMouse)->GetFunction ());
41
53
42
54
target->Set (String::NewSymbol (" getMousePos" ),
43
55
FunctionTemplate::New (getMousePos)->GetFunction ());
56
+
57
+ target->Set (String::NewSymbol (" mouseClick" ),
58
+ FunctionTemplate::New (mouseClick)->GetFunction ());
44
59
}
45
60
NODE_MODULE (autonode, init)
You can’t perform that action at this time.
0 commit comments