mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-04 16:03:54 +00:00
add KeyTap() args[2] delay support
This commit is contained in:
parent
537e89c6fd
commit
80aea16f32
@ -545,7 +545,7 @@ func KeyTap(tapKey string, args ...interface{}) string {
|
|||||||
zkey := C.CString(tapKey)
|
zkey := C.CString(tapKey)
|
||||||
defer C.free(unsafe.Pointer(zkey))
|
defer C.free(unsafe.Pointer(zkey))
|
||||||
|
|
||||||
if len(args) > 2 {
|
if len(args) > 2 && (reflect.TypeOf(args[2]) != reflect.TypeOf(num)) {
|
||||||
num = len(args)
|
num = len(args)
|
||||||
for i := 0; i < num; i++ {
|
for i := 0; i < num; i++ {
|
||||||
s := args[i].(string)
|
s := args[i].(string)
|
||||||
@ -576,6 +576,9 @@ func KeyTap(tapKey string, args ...interface{}) string {
|
|||||||
if len(args) > 1 {
|
if len(args) > 1 {
|
||||||
if reflect.TypeOf(args[1]) == reflect.TypeOf(akey) {
|
if reflect.TypeOf(args[1]) == reflect.TypeOf(akey) {
|
||||||
keyT = args[1].(string)
|
keyT = args[1].(string)
|
||||||
|
if len(args) > 2 {
|
||||||
|
keyDelay = args[2].(int)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
keyDelay = args[1].(int)
|
keyDelay = args[1].(int)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user