@@ -486,7 +486,7 @@ func toErr(str *C.char) error {
486
486
return errors .New (gstr )
487
487
}
488
488
489
- func appendShift (key string , len1 int , args ... interface {}) []interface {} {
489
+ func appendShift (key string , len1 int , args ... interface {}) ( string , []interface {}) {
490
490
if len (key ) > 0 && unicode .IsUpper ([]rune (key )[0 ]) {
491
491
args = append (args , "shift" )
492
492
}
@@ -499,7 +499,7 @@ func appendShift(key string, len1 int, args ...interface{}) []interface{} {
499
499
}
500
500
}
501
501
502
- return args
502
+ return key , args
503
503
}
504
504
505
505
// KeyTap taps the keyboard code;
@@ -520,7 +520,7 @@ func appendShift(key string, len1 int, args ...interface{}) []interface{} {
520
520
// robotgo.KeyTap("k", pid int)
521
521
func KeyTap (key string , args ... interface {}) error {
522
522
var keyArr []string
523
- args = appendShift (key , 0 , args ... )
523
+ key , args = appendShift (key , 0 , args ... )
524
524
525
525
pid := 0
526
526
if len (args ) > 0 {
@@ -563,7 +563,7 @@ func getToggleArgs(args ...interface{}) (pid int, keyArr []string) {
563
563
// robotgo.KeyToggle("a", "up", "alt", "cmd")
564
564
// robotgo.KeyToggle("k", pid int)
565
565
func KeyToggle (key string , args ... interface {}) error {
566
- args = appendShift (key , 1 , args ... )
566
+ key , args = appendShift (key , 1 , args ... )
567
567
pid , keyArr := getToggleArgs (args ... )
568
568
return keyToggles (key , keyArr , pid )
569
569
}
0 commit comments