mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-02 23:23:55 +00:00
update TypeString function code [Drop]
This commit is contained in:
parent
2eba2fee5d
commit
0e570e2eb9
@ -797,10 +797,15 @@ func PasteStr(str string) string {
|
|||||||
|
|
||||||
// TypeString send a string, support unicode
|
// TypeString send a string, support unicode
|
||||||
// TypeStr(string: The string to send), Wno-deprecated
|
// TypeStr(string: The string to send), Wno-deprecated
|
||||||
func TypeString(str string) {
|
func TypeString(str string, delay ...int) {
|
||||||
tt.Drop("TypeString", "TypeStr")
|
tt.Drop("TypeString", "TypeStr")
|
||||||
|
var cdelay C.size_t
|
||||||
cstr := C.CString(str)
|
cstr := C.CString(str)
|
||||||
C.type_string(cstr)
|
if len(delay) > 0 {
|
||||||
|
cdelay = C.size_t(delay[0])
|
||||||
|
}
|
||||||
|
|
||||||
|
C.type_string_delayed(cstr, cdelay)
|
||||||
|
|
||||||
C.free(unsafe.Pointer(cstr))
|
C.free(unsafe.Pointer(cstr))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user