mirror of
https://github.com/go-vgo/robotgo
synced 2026-05-23 17:59:12 +00:00
Update clipboard example code
This commit is contained in:
parent
7bbc39e975
commit
d008e6aa25
1 changed files with 11 additions and 6 deletions
|
|
@ -7,14 +7,19 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
clipboard.WriteAll("日本語")
|
||||
err := clipboard.WriteAll("日本語")
|
||||
if err != nil {
|
||||
log.Println("clipboard write all error: ", err)
|
||||
}
|
||||
|
||||
text, err := clipboard.ReadAll()
|
||||
if err != nil {
|
||||
log.Println("clipboard read all error: ", err)
|
||||
} else {
|
||||
if text != "" {
|
||||
log.Println("text is: ", text)
|
||||
// Output: 日本語
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if text != "" {
|
||||
log.Println("text is: ", text)
|
||||
// Output: 日本語
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue