fmt and update keytoggle code

This commit is contained in:
vcaesar 2018-02-03 16:24:49 +08:00
parent e0f9739fa2
commit 8a94d16c46

View File

@ -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)