mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
update code name style
This commit is contained in:
parent
1e8f73884e
commit
76898b335b
@ -9,7 +9,7 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// The hook directory link from the https://github.com/robotn/gohook/
|
// 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
|
// See the LICENSE file at the top-level directory of this distribution and at
|
||||||
// https://github.com/robotn/gohook/blob/master/LICENSE
|
// https://github.com/robotn/gohook/blob/master/LICENSE
|
||||||
|
|
||||||
@ -149,9 +149,9 @@ void dispatch_proc(iohook_event * const event) {
|
|||||||
// fprintf(stdout, "----%s\n", buffer);
|
// fprintf(stdout, "----%s\n", buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
int add_event(char *aevent) {
|
int add_event(char *key_event) {
|
||||||
// (uint16_t *)
|
// (uint16_t *)
|
||||||
cevent = aevent;
|
cevent = key_event;
|
||||||
// Set the logger callback for library output.
|
// Set the logger callback for library output.
|
||||||
hookSetlogger(&loggerProc);
|
hookSetlogger(&loggerProc);
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// The hook directory link from the https://github.com/robotn/gohook/
|
// 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
|
// See the LICENSE file at the top-level directory of this distribution and at
|
||||||
// https://github.com/robotn/gohook/blob/master/LICENSE
|
// https://github.com/robotn/gohook/blob/master/LICENSE
|
||||||
|
|
||||||
@ -51,9 +51,9 @@ int cstatus = 1;
|
|||||||
|
|
||||||
|
|
||||||
int stop_event();
|
int stop_event();
|
||||||
int add_event(char *aevent);
|
int add_event(char *key_event);
|
||||||
// int allEvent(char *aevent);
|
// int allEvent(char *key_event);
|
||||||
int allEvent(char *aevent, int vcode[], int size);
|
int allEvent(char *key_event, int vcode[], int size);
|
||||||
|
|
||||||
// NOTE: The following callback executes on the same thread that hook_run() is called
|
// NOTE: The following callback executes on the same thread that hook_run() is called
|
||||||
// from.
|
// from.
|
||||||
|
12
robotgo.go
12
robotgo.go
@ -1198,7 +1198,7 @@ func GetImgSize(imgPath string) (int, int) {
|
|||||||
//
|
//
|
||||||
// mouse arguments: mleft, mright, wheelDown, wheelUp,
|
// mouse arguments: mleft, mright, wheelDown, wheelUp,
|
||||||
// wheelLeft, wheelRight.
|
// wheelLeft, wheelRight.
|
||||||
func AddEvent(aeve string) int {
|
func AddEvent(key string) int {
|
||||||
keycode := Map{
|
keycode := Map{
|
||||||
"f1": "59",
|
"f1": "59",
|
||||||
"f2": "60",
|
"f2": "60",
|
||||||
@ -1233,19 +1233,19 @@ func AddEvent(aeve string) int {
|
|||||||
)
|
)
|
||||||
|
|
||||||
for i := 0; i < len(mArr); i++ {
|
for i := 0; i < len(mArr); i++ {
|
||||||
if aeve == mArr[i] {
|
if key == mArr[i] {
|
||||||
mouseBool = true
|
mouseBool = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(aeve) > 1 && !mouseBool {
|
if len(key) > 1 && !mouseBool {
|
||||||
keve = keycode[aeve].(string)
|
keve = keycode[key].(string)
|
||||||
cs = C.CString(keve)
|
cs = C.CString(keve)
|
||||||
} else {
|
} else {
|
||||||
cs = C.CString(aeve)
|
cs = C.CString(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
// cs := C.CString(aeve)
|
// cs := C.CString(key)
|
||||||
eve := C.add_event(cs)
|
eve := C.add_event(cs)
|
||||||
// fmt.Println("event@@", eve)
|
// fmt.Println("event@@", eve)
|
||||||
geve := int(eve)
|
geve := int(eve)
|
||||||
|
Loading…
Reference in New Issue
Block a user