mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 06:33:56 +00:00
update PasteStr function code return error
This commit is contained in:
parent
079dcfc995
commit
550fc6a80b
20
robotgo.go
20
robotgo.go
@ -785,6 +785,16 @@ func UnicodeType(str uint32) {
|
||||
C.unicodeType(cstr)
|
||||
}
|
||||
|
||||
// PasteStr paste a string, support UTF-8
|
||||
func PasteStr(str string) string {
|
||||
clipboard.WriteAll(str)
|
||||
if runtime.GOOS == "darwin" {
|
||||
return KeyTap("v", "command")
|
||||
}
|
||||
|
||||
return KeyTap("v", "control")
|
||||
}
|
||||
|
||||
// TypeString send a string, support unicode
|
||||
// TypeStr(string: The string to send), Wno-deprecated
|
||||
func TypeString(str string) {
|
||||
@ -795,16 +805,6 @@ func TypeString(str string) {
|
||||
C.free(unsafe.Pointer(cstr))
|
||||
}
|
||||
|
||||
// PasteStr paste a string, support UTF-8
|
||||
func PasteStr(str string) {
|
||||
clipboard.WriteAll(str)
|
||||
if runtime.GOOS == "darwin" {
|
||||
KeyTap("v", "command")
|
||||
} else {
|
||||
KeyTap("v", "control")
|
||||
}
|
||||
}
|
||||
|
||||
// TypeStrDelay type string delayed
|
||||
func TypeStrDelay(str string, delay int) {
|
||||
TypeStr(str)
|
||||
|
Loading…
Reference in New Issue
Block a user