Update MouseClick

This commit is contained in:
vCaesar 2016-11-12 21:14:44 +08:00
parent cddd083cea
commit 322bc1d0e6
3 changed files with 11 additions and 2 deletions

View File

@ -9,7 +9,7 @@
// except according to those terms. // except according to those terms.
#include "../base/types.h" #include "../base/types.h"
#include "mouse_init.h" #include "mouse_c.h"
//Global delays. //Global delays.
int mouseDelay = 10; int mouseDelay = 10;

View File

@ -172,7 +172,16 @@ func MouseClick(args ...interface{}) {
var button C.MMMouseButton var button C.MMMouseButton
var double C.bool var double C.bool
Try(func() { Try(func() {
button = args[0].(C.MMMouseButton) // button = args[0].(C.MMMouseButton)
if args[0].(string) == "left" {
button = C.LEFT_BUTTON
}
if args[0].(string) == "center" {
button = C.CENTER_BUTTON
}
if args[0].(string) == "right" {
button = C.RIGHT_BUTTON
}
double = C.bool(args[1].(bool)) double = C.bool(args[1].(bool))
}, func(e interface{}) { }, func(e interface{}) {
// Println("err:::", e) // Println("err:::", e)