mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-02 23:23:55 +00:00
Merge pull request #347 from go-vgo/bitmap-pr
add mac os M1 support and update examples
This commit is contained in:
commit
336f647d75
2
.gitignore
vendored
2
.gitignore
vendored
@ -56,6 +56,8 @@ vendor
|
|||||||
# ##
|
# ##
|
||||||
*.a
|
*.a
|
||||||
!cdeps/mac/libpng.a
|
!cdeps/mac/libpng.a
|
||||||
|
!cdeps/mac/amd/libpng.a
|
||||||
|
!cdeps/mac/m1/libpng.a
|
||||||
!cdeps/win32/libpng.a
|
!cdeps/win32/libpng.a
|
||||||
!cdeps/win64/libpng.a
|
!cdeps/win64/libpng.a
|
||||||
#
|
#
|
||||||
|
BIN
cdeps/mac/m1/libpng.a
Normal file
BIN
cdeps/mac/m1/libpng.a
Normal file
Binary file not shown.
@ -7,14 +7,19 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
clipboard.WriteAll("日本語")
|
err := clipboard.WriteAll("日本語")
|
||||||
|
if err != nil {
|
||||||
|
log.Println("clipboard write all error: ", err)
|
||||||
|
}
|
||||||
|
|
||||||
text, err := clipboard.ReadAll()
|
text, err := clipboard.ReadAll()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("clipboard read all error: ", err)
|
log.Println("clipboard read all error: ", err)
|
||||||
} else {
|
return
|
||||||
if text != "" {
|
}
|
||||||
log.Println("text is: ", text)
|
|
||||||
// Output: 日本語
|
if text != "" {
|
||||||
}
|
log.Println("text is: ", text)
|
||||||
|
// Output: 日本語
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,8 @@ package robotgo
|
|||||||
#cgo darwin CFLAGS: -x objective-c -Wno-deprecated-declarations
|
#cgo darwin CFLAGS: -x objective-c -Wno-deprecated-declarations
|
||||||
#cgo darwin LDFLAGS: -framework Cocoa -framework OpenGL -framework IOKit
|
#cgo darwin LDFLAGS: -framework Cocoa -framework OpenGL -framework IOKit
|
||||||
#cgo darwin LDFLAGS: -framework Carbon -framework CoreFoundation
|
#cgo darwin LDFLAGS: -framework Carbon -framework CoreFoundation
|
||||||
#cgo darwin LDFLAGS:-L${SRCDIR}/cdeps/mac -lpng -lz
|
#cgo darwin,amd64 LDFLAGS:-L${SRCDIR}/cdeps/mac/amd -lpng -lz
|
||||||
|
#cgo darwin,arm64 LDFLAGS:-L${SRCDIR}/cdeps/mac/m1 -lpng -lz
|
||||||
//#elif defined(USE_X11)
|
//#elif defined(USE_X11)
|
||||||
// Drop -std=c11
|
// Drop -std=c11
|
||||||
#cgo linux CFLAGS: -I/usr/src
|
#cgo linux CFLAGS: -I/usr/src
|
||||||
|
Loading…
Reference in New Issue
Block a user