mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-19 14:23:55 +00:00
fmt and update keytoggle code
This commit is contained in:
parent
e0f9739fa2
commit
8a94d16c46
19
robotgo.go
19
robotgo.go
@ -63,7 +63,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
version string = "v0.48.0.505, Ben Nevis!"
|
version string = "v0.48.0.506, Ben Nevis!"
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
@ -630,24 +630,23 @@ func KeyToggle(args ...string) string {
|
|||||||
// keyDelay = 10
|
// keyDelay = 10
|
||||||
)
|
)
|
||||||
|
|
||||||
Try(func() {
|
if len(args) > 1 {
|
||||||
adown = args[1]
|
adown = args[1]
|
||||||
|
|
||||||
if len(args) > 2 {
|
if len(args) > 2 {
|
||||||
amkey = args[2]
|
amkey = args[2]
|
||||||
|
|
||||||
Try(func() {
|
if len(args) > 3 {
|
||||||
mKeyT = args[3]
|
mKeyT = args[3]
|
||||||
}, func(e interface{}) {
|
} else {
|
||||||
// fmt.Println("err:::", e)
|
|
||||||
mKeyT = "null"
|
mKeyT = "null"
|
||||||
})
|
}
|
||||||
} else {
|
} else {
|
||||||
amkey = "null"
|
amkey = "null"
|
||||||
}
|
}
|
||||||
}, func(e interface{}) {
|
} else {
|
||||||
// fmt.Println("err:::", e)
|
|
||||||
adown = "null"
|
adown = "null"
|
||||||
})
|
}
|
||||||
|
|
||||||
ckey := C.CString(args[0])
|
ckey := C.CString(args[0])
|
||||||
cadown := C.CString(adown)
|
cadown := C.CString(adown)
|
||||||
@ -1096,7 +1095,7 @@ func CountColorCS(x, y, w, h int, color CHex, args ...float32) int {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// AddEvent add event listener
|
// AddEvent add event listener
|
||||||
// parameters for the string type,
|
// parameters for the string type,
|
||||||
// the keyboard corresponding key parameters
|
// the keyboard corresponding key parameters
|
||||||
// mouse arguments: mleft, mright, wheelDown, wheelUp,
|
// mouse arguments: mleft, mright, wheelDown, wheelUp,
|
||||||
// wheelLeft, wheelRight
|
// wheelLeft, wheelRight
|
||||||
|
Loading…
Reference in New Issue
Block a user