From 633665224bc583f4c9f10125f2111bc30c2ab2e3 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Sun, 24 Dec 2017 23:01:22 +0800 Subject: [PATCH] add CBitmap and more examples --- examples/key/main.go | 3 +++ examples/main.go | 5 +++++ examples/screen/main.go | 2 ++ robotgo.go | 4 +++- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/key/main.go b/examples/key/main.go index cfe2b5a..a7c66fb 100644 --- a/examples/key/main.go +++ b/examples/key/main.go @@ -30,11 +30,14 @@ func main() { robotgo.KeyTap("a", "control") // hide window robotgo.KeyTap("h", "command") + robotgo.KeyTap("h", "command", 12) // press "i", "alt", "command" Key combination robotgo.KeyTap("i", "alt", "command") + robotgo.KeyTap("i", "alt", "command", 11) arr := []string{"alt", "command"} robotgo.KeyTap("i", arr) + robotgo.KeyTap("i", arr, 12) // close window robotgo.KeyTap("w", "command") diff --git a/examples/main.go b/examples/main.go index 9e78ed1..2a55f21 100644 --- a/examples/main.go +++ b/examples/main.go @@ -30,11 +30,14 @@ func key() { robotgo.KeyTap("a", "control") // hide window robotgo.KeyTap("h", "command") + robotgo.KeyTap("h", "command", 12) // press "i", "alt", "command" Key combination robotgo.KeyTap("i", "alt", "command") + robotgo.KeyTap("i", "alt", "command", 11) arr := []string{"alt", "command"} robotgo.KeyTap("i", arr) + robotgo.KeyTap("i", arr, 12) // close window robotgo.KeyTap("w", "command") @@ -122,6 +125,8 @@ func screen() { // gets the pixel color at 100, 200. color := robotgo.GetPixelColor(100, 200) fmt.Println("color----", color, "-----------------") + clo := robotgo.GetPxColor(100, 200) + fmt.Println("color...", clo) // gets the pixel color at 10, 20. color2 := robotgo.GetPixelColor(10, 20) diff --git a/examples/screen/main.go b/examples/screen/main.go index 5376276..83806ee 100644 --- a/examples/screen/main.go +++ b/examples/screen/main.go @@ -38,6 +38,8 @@ func main() { // gets the pixel color at 100, 200. color := robotgo.GetPixelColor(100, 200) fmt.Println("color----", color, "-----------------") + clo := robotgo.GetPxColor(100, 200) + fmt.Println("color...", clo) // gets the pixel color at 10, 20. color2 := robotgo.GetPixelColor(10, 20) diff --git a/robotgo.go b/robotgo.go index 3e07475..956eb44 100644 --- a/robotgo.go +++ b/robotgo.go @@ -62,7 +62,7 @@ import ( ) const ( - version string = "v0.47.0.449, Mount Cook!" + version string = "v0.47.0.455, Mount Cook!" ) type ( @@ -70,6 +70,8 @@ type ( Map map[string]interface{} // CHex c rgb Hex type CHex C.MMRGBHex + // CBitmap c bitmap type C.MMBitmapRef + CBitmap C.MMBitmapRef ) // Bitmap is Bitmap struct