mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-31 06:13:55 +00:00
Update: move type conversion to key.md and update godoc
This commit is contained in:
parent
d249cdcd9e
commit
cbca6d08c7
24
README.md
24
README.md
@ -29,7 +29,7 @@ RobotGo supports Mac, Windows, and Linux(X11); and robotgo supports arm64 and x8
|
|||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
- [Update](#update)
|
- [Update](#update)
|
||||||
- [Examples](#examples)
|
- [Examples](#examples)
|
||||||
- [Type Conversion](#type-conversion)
|
- [Type Conversion and keys](https://github.com/go-vgo/robotgo/blob/master/docs/keys.md)
|
||||||
- [Cross-Compiling](#crosscompiling)
|
- [Cross-Compiling](#crosscompiling)
|
||||||
- [Authors](#authors)
|
- [Authors](#authors)
|
||||||
- [Plans](#plans)
|
- [Plans](#plans)
|
||||||
@ -488,28 +488,6 @@ func main() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Type Conversion
|
|
||||||
|
|
||||||
| | type conversion | func
|
|
||||||
|-----|---------------------|----------------------
|
|
||||||
| * | robotgo.Bitmap -> robotgo.CBitmap | robotgo.ToCBitmap()
|
|
||||||
| | robotgo.Bitmap -> *image.RGBA | robotgo.ToRGBAGo()
|
|
||||||
| * | robotgo.CBitmap -> C.MMBitmapRef | robotgo.ToMMBitmapRef()
|
|
||||||
| | robotgo.CBitmap -> robotgo.Bitmap | robotgo.ToBitmap()
|
|
||||||
| | robotgo.CBitmap -> image.Image | robotgo.ToImage()
|
|
||||||
| | robotgo.CBitmap -> *image.RGBA | robotgo.ToRGBA()
|
|
||||||
| * | C.MMBitmapRef -> robotgo.CBitmap | robotgo.CBitmap()
|
|
||||||
| * | image.Image -> robotgo.Bitmap | robotgo.ImgToBitmap()
|
|
||||||
| | image.Image -> robotgo.CBitmap | robotgo.ImgToCBitmap()
|
|
||||||
| | image.Image -> []byte | robotgo.ToByteImg()
|
|
||||||
| | image.Image -> string | robotgo.ToStringImg()
|
|
||||||
| * | *image.RGBA -> robotgo.Bitmap | robotgo.RGBAToBitmap()
|
|
||||||
| * | []byte -> image.Image | robotgo.ByteToImg()
|
|
||||||
| | []byte-> robotgo.CBitmap | robotgo.ByteToCBitmap()
|
|
||||||
| | []byte -> string | string()
|
|
||||||
| * | string -> image.Image | robotgo.StrToImg()
|
|
||||||
| | string -> byte | []byte()
|
|
||||||
|
|
||||||
## CrossCompiling
|
## CrossCompiling
|
||||||
|
|
||||||
##### Windows64 to windows32
|
##### Windows64 to windows32
|
||||||
|
24
docs/keys.md
24
docs/keys.md
@ -1,3 +1,25 @@
|
|||||||
|
## Type Conversion
|
||||||
|
|
||||||
|
| | type conversion | func |
|
||||||
|
| --- | --------------------------------- | ----------------------- |
|
||||||
|
| \* | robotgo.Bitmap -> robotgo.CBitmap | robotgo.ToCBitmap() |
|
||||||
|
| | robotgo.Bitmap -> \*image.RGBA | robotgo.ToRGBAGo() |
|
||||||
|
| \* | robotgo.CBitmap -> C.MMBitmapRef | robotgo.ToMMBitmapRef() |
|
||||||
|
| | robotgo.CBitmap -> robotgo.Bitmap | robotgo.ToBitmap() |
|
||||||
|
| | robotgo.CBitmap -> image.Image | robotgo.ToImage() |
|
||||||
|
| | robotgo.CBitmap -> \*image.RGBA | robotgo.ToRGBA() |
|
||||||
|
| \* | C.MMBitmapRef -> robotgo.CBitmap | robotgo.CBitmap() |
|
||||||
|
| \* | image.Image -> robotgo.Bitmap | robotgo.ImgToBitmap() |
|
||||||
|
| | image.Image -> robotgo.CBitmap | robotgo.ImgToCBitmap() |
|
||||||
|
| | image.Image -> []byte | robotgo.ToByteImg() |
|
||||||
|
| | image.Image -> string | robotgo.ToStringImg() |
|
||||||
|
| \* | \*image.RGBA -> robotgo.Bitmap | robotgo.RGBAToBitmap() |
|
||||||
|
| \* | []byte -> image.Image | robotgo.ByteToImg() |
|
||||||
|
| | []byte-> robotgo.CBitmap | robotgo.ByteToCBitmap() |
|
||||||
|
| | []byte -> string | string() |
|
||||||
|
| \* | string -> image.Image | robotgo.StrToImg() |
|
||||||
|
| | string -> byte | []byte() |
|
||||||
|
|
||||||
# Keys
|
# Keys
|
||||||
|
|
||||||
```Go
|
```Go
|
||||||
@ -118,4 +140,4 @@
|
|||||||
"lights_kbd_toggle" Toggle keyboard backlight on/off No Windows support
|
"lights_kbd_toggle" Toggle keyboard backlight on/off No Windows support
|
||||||
"lights_kbd_up" Turn up keyboard backlight brightness No Windows support
|
"lights_kbd_up" Turn up keyboard backlight brightness No Windows support
|
||||||
"lights_kbd_down" Turn down keyboard backlight brightness No Windows support
|
"lights_kbd_down" Turn down keyboard backlight brightness No Windows support
|
||||||
```
|
```
|
||||||
|
4
key.go
4
key.go
@ -482,7 +482,7 @@ func toErr(str *C.char) error {
|
|||||||
|
|
||||||
// KeyTap taps the keyboard code;
|
// KeyTap taps the keyboard code;
|
||||||
//
|
//
|
||||||
// See keys:
|
// See keys supported:
|
||||||
//
|
//
|
||||||
// https://github.com/go-vgo/robotgo/blob/master/docs/keys.md
|
// https://github.com/go-vgo/robotgo/blob/master/docs/keys.md
|
||||||
//
|
//
|
||||||
@ -613,7 +613,7 @@ func CharCodeAt(s string, n int) rune {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnicodeType tap uint32 unicode
|
// UnicodeType tap the uint32 unicode
|
||||||
func UnicodeType(str uint32, args ...int) {
|
func UnicodeType(str uint32, args ...int) {
|
||||||
cstr := C.uint(str)
|
cstr := C.uint(str)
|
||||||
pid := 0
|
pid := 0
|
||||||
|
@ -88,7 +88,11 @@ type (
|
|||||||
CBitmap C.MMBitmapRef
|
CBitmap C.MMBitmapRef
|
||||||
)
|
)
|
||||||
|
|
||||||
// Bitmap is Bitmap struct
|
// Bitmap define the go Bitmap struct
|
||||||
|
//
|
||||||
|
// The common type conversion of bitmap:
|
||||||
|
//
|
||||||
|
// https://github.com/go-vgo/robotgo/blob/master/docs/keys.md
|
||||||
type Bitmap struct {
|
type Bitmap struct {
|
||||||
ImgBuf *uint8
|
ImgBuf *uint8
|
||||||
Width, Height int
|
Width, Height int
|
||||||
|
Loading…
Reference in New Issue
Block a user