mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 06:33:56 +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)
|
||||
defer C.free(unsafe.Pointer(zkey))
|
||||
|
||||
if len(args) > 2 {
|
||||
if len(args) > 2 && (reflect.TypeOf(args[2]) != reflect.TypeOf(num)) {
|
||||
num = len(args)
|
||||
for i := 0; i < num; i++ {
|
||||
s := args[i].(string)
|
||||
@ -576,6 +576,9 @@ func KeyTap(tapKey string, args ...interface{}) string {
|
||||
if len(args) > 1 {
|
||||
if reflect.TypeOf(args[1]) == reflect.TypeOf(akey) {
|
||||
keyT = args[1].(string)
|
||||
if len(args) > 2 {
|
||||
keyDelay = args[2].(int)
|
||||
}
|
||||
} else {
|
||||
keyDelay = args[1].(int)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user