mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-31 06:13:55 +00:00
update some c name and fmt code
This commit is contained in:
parent
4af3883371
commit
df79f9793b
@ -53,9 +53,9 @@ void dispatch_proc(iohook_event * const event) {
|
||||
snprintf(buffer + length, sizeof(buffer) - length,
|
||||
",keycode=%u,rawcode=0x%X",
|
||||
event->data.keyboard.keycode, event->data.keyboard.rawcode);
|
||||
int akeycode = (uint16_t) event->data.keyboard.keycode;
|
||||
int akeyCode = (uint16_t) event->data.keyboard.keycode;
|
||||
// printf("atoi(str)---%d\n", atoi(cevent));
|
||||
if (akeycode == atoi(cevent)){
|
||||
if (akeyCode == atoi(cevent)){
|
||||
int stopEvent = stop_event();
|
||||
// printf("%d\n", stopEvent);
|
||||
cstatus = 0;
|
||||
|
@ -113,7 +113,7 @@ int mouse_toggle(char* d, MMMouseButton button){
|
||||
return 0;
|
||||
}
|
||||
|
||||
int set_mouseDelay(size_t val){
|
||||
int set_mouse_delay(size_t val){
|
||||
// int val = 10;
|
||||
mouseDelay = val;
|
||||
|
||||
|
18
robotgo.go
18
robotgo.go
@ -373,8 +373,8 @@ func MoveMouseSmooth(x, y int, args ...interface{}) {
|
||||
|
||||
var (
|
||||
mouseDelay = 10
|
||||
low C.double
|
||||
high C.double
|
||||
low C.double
|
||||
high C.double
|
||||
)
|
||||
|
||||
if len(args) > 2 {
|
||||
@ -399,8 +399,8 @@ func MoveSmooth(x, y int, args ...interface{}) {
|
||||
|
||||
var (
|
||||
mouseDelay = 10
|
||||
low C.double
|
||||
high C.double
|
||||
low C.double
|
||||
high C.double
|
||||
)
|
||||
|
||||
if len(args) > 2 {
|
||||
@ -518,7 +518,7 @@ func MouseToggle(args ...interface{}) {
|
||||
// SetMouseDelay set mouse delay
|
||||
func SetMouseDelay(x int) {
|
||||
cx := C.size_t(x)
|
||||
C.set_mouseDelay(cx)
|
||||
C.set_mouse_delay(cx)
|
||||
}
|
||||
|
||||
// ScrollMouse scroll the mouse
|
||||
@ -612,9 +612,9 @@ func KeyTap(args ...interface{}) {
|
||||
// https://github.com/go-vgo/robotgo/blob/master/docs/keys.md
|
||||
func KeyToggle(args ...string) string {
|
||||
var (
|
||||
adown string
|
||||
amkey string
|
||||
mKeyT string
|
||||
adown string
|
||||
amkey string
|
||||
mKeyT string
|
||||
// keyDelay = 10
|
||||
)
|
||||
|
||||
@ -642,7 +642,7 @@ func KeyToggle(args ...string) string {
|
||||
camkey := C.CString(amkey)
|
||||
cmKeyT := C.CString(mKeyT)
|
||||
// defer func() {
|
||||
str:=C.key_toggle(ckey, cadown, camkey, cmKeyT)
|
||||
str := C.key_toggle(ckey, cadown, camkey, cmKeyT)
|
||||
// str := C.key_Toggle(ckey, cadown, camkey, cmKeyT, C.int(keyDelay))
|
||||
// fmt.Println(str)
|
||||
// }()
|
||||
|
Loading…
Reference in New Issue
Block a user