diff --git a/event/goEvent.h b/event/goEvent.h index ba4d118..f01c3ad 100644 --- a/event/goEvent.h +++ b/event/goEvent.h @@ -9,7 +9,7 @@ // except according to those terms. // // The hook directory link from the https://github.com/robotn/gohook/ -// event/hook, you need to follow the relevant agreement and LICENSE. +// hook, you need to follow the relevant agreement and LICENSE. // See the LICENSE file at the top-level directory of this distribution and at // https://github.com/robotn/gohook/blob/master/LICENSE @@ -149,9 +149,9 @@ void dispatch_proc(iohook_event * const event) { // fprintf(stdout, "----%s\n", buffer); } -int add_event(char *aevent) { +int add_event(char *key_event) { // (uint16_t *) - cevent = aevent; + cevent = key_event; // Set the logger callback for library output. hookSetlogger(&loggerProc); diff --git a/event/pub.h b/event/pub.h index f1c3ed3..d58218b 100644 --- a/event/pub.h +++ b/event/pub.h @@ -9,7 +9,7 @@ // except according to those terms. // // The hook directory link from the https://github.com/robotn/gohook/ -// event/hook, you need to follow the relevant agreement and LICENSE. +// hook, you need to follow the relevant agreement and LICENSE. // See the LICENSE file at the top-level directory of this distribution and at // https://github.com/robotn/gohook/blob/master/LICENSE @@ -51,9 +51,9 @@ int cstatus = 1; int stop_event(); -int add_event(char *aevent); -// int allEvent(char *aevent); -int allEvent(char *aevent, int vcode[], int size); +int add_event(char *key_event); +// int allEvent(char *key_event); +int allEvent(char *key_event, int vcode[], int size); // NOTE: The following callback executes on the same thread that hook_run() is called // from. diff --git a/robotgo.go b/robotgo.go index b7ec703..b43ebee 100644 --- a/robotgo.go +++ b/robotgo.go @@ -1198,7 +1198,7 @@ func GetImgSize(imgPath string) (int, int) { // // mouse arguments: mleft, mright, wheelDown, wheelUp, // wheelLeft, wheelRight. -func AddEvent(aeve string) int { +func AddEvent(key string) int { keycode := Map{ "f1": "59", "f2": "60", @@ -1233,19 +1233,19 @@ func AddEvent(aeve string) int { ) for i := 0; i < len(mArr); i++ { - if aeve == mArr[i] { + if key == mArr[i] { mouseBool = true } } - if len(aeve) > 1 && !mouseBool { - keve = keycode[aeve].(string) + if len(key) > 1 && !mouseBool { + keve = keycode[key].(string) cs = C.CString(keve) } else { - cs = C.CString(aeve) + cs = C.CString(key) } - // cs := C.CString(aeve) + // cs := C.CString(key) eve := C.add_event(cs) // fmt.Println("event@@", eve) geve := int(eve)