From 99101f5ee7cae7a2a58fed02d8f4cbc3bed7ba8c Mon Sep 17 00:00:00 2001 From: chandrajeetn Date: Wed, 5 Jun 2024 18:51:16 +0530 Subject: [PATCH] commited --- .github/workflows/go.yml | 16 ++-- doc.go | 2 +- examples/README.md | 166 -------------------------------------- examples/key/main.go | 134 ------------------------------ examples/keyboard/main.go | 26 ++++++ examples/main.go | 41 ---------- examples/mouse/main.go | 99 ----------------------- examples/scale/main.go | 51 ------------ examples/screen/main.go | 98 ---------------------- examples/window/main.go | 160 ------------------------------------ img.go | 2 +- key.go | 2 +- keycode.go | 2 +- ps.go | 2 +- robot_info_test.go | 2 +- robotgo.go | 2 +- robotgo_adb.go | 2 +- robotgo_android.go | 2 +- robotgo_fn_v1.go | 2 +- robotgo_mac.go | 2 +- robotgo_mac_unix.go | 2 +- robotgo_mac_win.go | 2 +- robotgo_ocr.go | 2 +- robotgo_test.go | 2 +- robotgo_win.go | 2 +- robotgo_x11.go | 2 +- screen.go | 2 +- wayland_n.go | 2 +- windows_n.go | 2 +- 29 files changed, 56 insertions(+), 775 deletions(-) delete mode 100644 examples/README.md delete mode 100644 examples/key/main.go create mode 100644 examples/keyboard/main.go delete mode 100644 examples/main.go delete mode 100644 examples/mouse/main.go delete mode 100644 examples/scale/main.go delete mode 100644 examples/screen/main.go delete mode 100644 examples/window/main.go diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 2e4ff92..61ad633 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,12 +1,16 @@ -name: Go -on: [push] +name: Build +on: + pull_request: + branches: + - "**" + workflow_dispatch: jobs: - test: + build-latest: # name: build strategy: matrix: # go: [1.12.x, 1.13.x] - os: [macOS-latest, windows-latest] # ubuntu-latest + os: [macOS-latest, windows-latest, ubuntu-latest] # ubuntu-latest runs-on: ${{ matrix.os }} steps: @@ -22,9 +26,9 @@ jobs: - name: Get dependencies run: | go get -v -t -d ./... + go build -v ./... - name: Build run: go build -v . - name: Test - run: go test -v robot_info_test.go - # run: go test -v . + run: go test -v robot_info_test.go \ No newline at end of file diff --git a/doc.go b/doc.go index b28cde2..3f8bb6a 100644 --- a/doc.go +++ b/doc.go @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -package robotgo +package keyboard /* Keys are supported: diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index e7188e8..0000000 --- a/examples/README.md +++ /dev/null @@ -1,166 +0,0 @@ -# Robotgo examples - -## Install: -``` -go get -u github.com/go-vgo/robotgo -``` - -## [Examples:](https://github.com/go-vgo/robotgo/blob/master/examples) - -#### [Mouse](https://github.com/go-vgo/robotgo/blob/master/examples/mouse/main.go) - -```Go -package main - -import ( - "github.com/go-vgo/robotgo" -) - -func main() { - // robotgo.ScrollMouse(10, "up") - robotgo.Scroll(0, 10) - robotgo.MouseClick("left", true) - robotgo.MoveSmooth(100, 200, 1.0, 100.0) -} -``` - -#### [Keyboard](https://github.com/go-vgo/robotgo/blob/master/examples/key/main.go) - -```Go -package main - -import ( - "fmt" - - "github.com/go-vgo/robotgo" -) - -func main() { - robotgo.TypeStr("Hello World") - // robotgo.TypeStr("だんしゃり") - robotgo.TypeStr("だんしゃり") - // ustr := uint32(robotgo.CharCodeAt("だんしゃり", 0)) - // robotgo.UnicodeType(ustr) - - robotgo.KeyTap("enter") - robotgo.TypeStr("en") - robotgo.KeyTap("i", "alt", "command") - arr := []string{"alt", "command"} - robotgo.KeyTap("i", arr) - - robotgo.WriteAll("Test") - text, err := robotgo.ReadAll() - if err == nil { - fmt.Println(text) - } -} -``` - -#### [Screen](https://github.com/go-vgo/robotgo/blob/master/examples/screen/main.go) - -```Go -package main - -import ( - "fmt" - - "github.com/go-vgo/robotgo" -) - -func main() { - x, y := robotgo.Location() - fmt.Println("pos:", x, y) - color := robotgo.GetPixelColor(100, 200) - fmt.Println("color----", color) -} -``` - -#### [Bitmap](https://github.com/go-vgo/robotgo/blob/master/examples/bitmap/main.go) - -```Go -package main - -import ( - "fmt" - - "github.com/go-vgo/robotgo" -) - -func main() { - bitmap := robotgo.CaptureScreen(10, 20, 30, 40) - // use `defer robotgo.FreeBitmap(bit)` to free the bitmap - defer robotgo.FreeBitmap(bitmap) - fmt.Println("...", bitmap) - - fx, fy := robotgo.FindBitmap(bitmap) - fmt.Println("FindBitmap------", fx, fy) - - robotgo.SaveBitmap(bitmap, "test.png") -} -``` - -#### [Event](https://github.com/go-vgo/robotgo/blob/master/examples/event/main.go) - -```Go -package main - -import ( - "fmt" - - "github.com/go-vgo/robotgo" -) - -func main() { - keve := robotgo.AddEvent("k") - if keve { - fmt.Println("you press...", "k") - } - - mleft := robotgo.AddEvent("mleft") - if mleft { - fmt.Println("you press...", "mouse left button") - } -} -``` - -#### [Window](https://github.com/go-vgo/robotgo/blob/master/examples/window/main.go) - -```Go -package main - -import ( - "fmt" - - "github.com/go-vgo/robotgo" -) - -func main() { - fpid, err := robotgo.FindIds("Google") - if err == nil { - fmt.Println("pids...", fpid) - - if len(fpid) > 0 { - robotgo.ActivePID(fpid[0]) - - robotgo.Kill(fpid[0]) - } - } - - robotgo.ActiveName("chrome") - - isExist, err := robotgo.PidExists(100) - if err == nil && isExist { - fmt.Println("pid exists is", isExist) - - robotgo.Kill(100) - } - - abool := robotgo.ShowAlert("test", "robotgo") - if abool == 0 { - fmt.Println("ok@@@", "ok") - } - - title := robotgo.GetTitle() - fmt.Println("title@@@", title) -} -``` \ No newline at end of file diff --git a/examples/key/main.go b/examples/key/main.go deleted file mode 100644 index 84e1257..0000000 --- a/examples/key/main.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2016 The go-vgo Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// https://github.com/go-vgo/robotgo/blob/master/LICENSE -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -package main - -import ( - "fmt" - - "github.com/go-vgo/robotgo" - // "go-vgo/robotgo" -) - -func typeStr() { - // typing "Hello World" - robotgo.TypeStr("Hello World!", 0, 1) - robotgo.KeySleep = 100 - robotgo.TypeStr("だんしゃり") - - robotgo.TypeStr("Hi galaxy, hi stars, hi MT.Rainier, hi sea. こんにちは世界.") - robotgo.TypeStr("So, hi, bye! 你好, 再见!") - robotgo.Sleep(1) - - robotgo.TypeStr("Hi, Seattle space needle, Golden gate bridge, One world trade center.") - robotgo.MilliSleep(100) - - ustr := uint32(robotgo.CharCodeAt("So, hi, bye!", 0)) - robotgo.UnicodeType(ustr) - - err := robotgo.PasteStr("paste string") - fmt.Println("PasteStr: ", err) -} - -func keyTap() { - // press "enter" - robotgo.KeyTap("enter") - robotgo.KeyTap(robotgo.Enter) - robotgo.KeySleep = 200 - robotgo.KeyTap("a") - robotgo.MilliSleep(100) - robotgo.KeyTap("a", "ctrl") - - // hide window - err := robotgo.KeyTap("h", "cmd") - if err != nil { - fmt.Println("robotgo.KeyTap run error is: ", err) - } - - robotgo.KeyTap("h", "cmd") - - // press "i", "alt", "command" Key combination - robotgo.KeyTap(robotgo.KeyI, robotgo.Alt, robotgo.Cmd) - robotgo.KeyTap("i", "alt", "cmd") - - arr := []string{"alt", "cmd"} - robotgo.KeyTap("i", arr) - robotgo.KeyTap("i", arr) - - robotgo.KeyTap("i", "cmd", " alt", "shift") - - // close window - robotgo.KeyTap("w", "cmd") - - // minimize window - robotgo.KeyTap("m", "cmd") - - robotgo.KeyTap("f1", "ctrl") - robotgo.KeyTap("a", "control") -} - -func special() { - robotgo.TypeStr("{}") - robotgo.KeyTap("[", "]") - - robotgo.KeyToggle("(") - robotgo.KeyToggle("(", "up") -} - -func keyToggle() { - // robotgo.KeySleep = 150 - robotgo.KeyToggle(robotgo.KeyA) - robotgo.KeyToggle("a", "down", "alt") - robotgo.Sleep(1) - - robotgo.KeyToggle("a", "up", "alt", "cmd") - robotgo.MilliSleep(100) - robotgo.KeyToggle("q", "up", "alt", "cmd", "shift") - - err := robotgo.KeyToggle(robotgo.Enter) - if err != nil { - fmt.Println("robotgo.KeyToggle run error is: ", err) - } -} - -func cilp() { - // robotgo.TypeStr("en") - - // write string to clipboard - e := robotgo.WriteAll("テストする") - if e != nil { - fmt.Println("robotgo.WriteAll err is: ", e) - } - - // read string from clipboard - text, err := robotgo.ReadAll() - if err != nil { - fmt.Println("robotgo.ReadAll err is: ", err) - } - fmt.Println("text: ", text) -} - -func key() { - //////////////////////////////////////////////////////////////////////////////// - // Control the keyboard - //////////////////////////////////////////////////////////////////////////////// - - typeStr() - special() - - keyTap() - keyToggle() - - cilp() -} - -func main() { - key() -} diff --git a/examples/keyboard/main.go b/examples/keyboard/main.go new file mode 100644 index 0000000..5cbc5a8 --- /dev/null +++ b/examples/keyboard/main.go @@ -0,0 +1,26 @@ +package main + +import ( + "flag" + "fmt" + keyboard "github.com/go-vgo/robotgo" + "os" + "strings" +) + +func main() { + // Define a flag to accept the key combination from the command line + keysPtr := flag.String("keys", "", "Key combination to be pressed, e.g., 'cmd+shift+F'") + flag.Parse() + + // Check if a key combination was provided + if *keysPtr == "" { + fmt.Println("Please provide a key combination using the -keys flag.") + os.Exit(1) + } + + keys := strings.Split(*keysPtr, "^") + fmt.Printf("keys: %v\n", strings.Join(keys, "^")) + keyboard.KeyTap(keys[len(keys)-1], keys[:len(keys)-1]) + fmt.Printf("Key combination '%s' pressed.\n", *keysPtr) +} diff --git a/examples/main.go b/examples/main.go deleted file mode 100644 index eade852..0000000 --- a/examples/main.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2016 The go-vgo Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// https://github.com/go-vgo/robotgo/blob/master/LICENSE -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -package main - -import ( - "fmt" - - "github.com/go-vgo/robotgo" - // "go-vgo/robotgo" -) - -func main() { - ver := robotgo.GetVersion() - fmt.Println("robotgo version is: ", ver) - - // Control the keyboard - // key() - - // Control the mouse - // mouse() - - // Read the screen - // screen() - - // Bitmap and image processing - // bitmap() - - // Global event listener - // event() - - // Window Handle and progress - // window() -} diff --git a/examples/mouse/main.go b/examples/mouse/main.go deleted file mode 100644 index d9ef7e3..0000000 --- a/examples/mouse/main.go +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2016 The go-vgo Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// https://github.com/go-vgo/robotgo/blob/master/LICENSE -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -package main - -import ( - "fmt" - - "github.com/go-vgo/robotgo" - // "go-vgo/robotgo" -) - -func move() { - robotgo.MouseSleep = 100 - robotgo.Move(100, 200) - robotgo.MoveRelative(10, -200) - - // move the mouse to 100, 200 - robotgo.Move(100, 200) - - // drag mouse with smooth - robotgo.DragSmooth(10, 10) - robotgo.DragSmooth(100, 200, 1.0, 100.0) - - // smooth move the mouse to 100, 200 - robotgo.MoveSmooth(100, 200) - robotgo.MoveSmooth(100, 200, 1.0, 100.0) - robotgo.MoveSmoothRelative(10, -100, 1.0, 30.0) - - for i := 0; i < 1080; i += 1000 { - fmt.Println("i: ", i) - // MoveMouse(800, i) - robotgo.Move(800, i) - } -} - -func click() { - - // click the left mouse button - robotgo.Click() - - // click the right mouse button - robotgo.Click("right", false) - - // double click the left mouse button - robotgo.Click("left", true) -} - -func get() { - // gets the mouse coordinates - x, y := robotgo.Location() - fmt.Println("pos:", x, y) - if x == 456 && y == 586 { - fmt.Println("mouse...", "586") - } - - robotgo.Move(x, y) -} - -func toggleAndScroll() { - // scrolls the mouse either up - robotgo.ScrollDir(10, "up") - robotgo.ScrollDir(10, "right") - - robotgo.Scroll(100, 10) - robotgo.Scroll(0, -10) - - robotgo.Toggle("left") - robotgo.Toggle("left", "up") - - // toggles the right mouse button - robotgo.Toggle("right") - robotgo.Toggle("right", "up") -} - -func mouse() { - //////////////////////////////////////////////////////////////////////////////// - // Control the mouse - //////////////////////////////////////////////////////////////////////////////// - - move() - - click() - - get() - - toggleAndScroll() -} - -func main() { - mouse() -} diff --git a/examples/scale/main.go b/examples/scale/main.go deleted file mode 100644 index 704c75b..0000000 --- a/examples/scale/main.go +++ /dev/null @@ -1,51 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/go-vgo/robotgo" -) - -func main() { - // syscall.NewLazyDLL("user32.dll").NewProc("SetProcessDPIAware").Call() - - width, height := robotgo.GetScaleSize() - fmt.Println("get scale screen size: ", width, height) - - bitmap := robotgo.CaptureScreen(0, 0, width, height) - defer robotgo.FreeBitmap(bitmap) - // bitmap.Save(bitmap, "test.png") - robotgo.Save(robotgo.ToImage(bitmap), "test.png") - - robotgo.Scale = true - robotgo.Move(10, 10) - robotgo.MoveSmooth(100, 100) - - fmt.Println(robotgo.Location()) - - num := robotgo.DisplaysNum() - for i := 0; i < num; i++ { - rect := robotgo.GetScreenRect(i) - fmt.Println("rect: ", rect) - } -} - -func old() { - sx := robotgo.ScaleX() // Deprecated - s := robotgo.Scale1() // Deprecated, use the ScaleF() function - robotx, roboty := 35*s/100, 25*s/100 - fmt.Println("scale: ", sx, s, " pos: ", robotx, roboty) - - mx, my := robotgo.Location() - sx, sy := mx*s/100, my*s/100 - - rx, ry, rw, rh := sx, sy, robotx, roboty - // bit1 := robotgo.CaptureScreen(10, 20, robotw, roboth) - bit1 := robotgo.CaptureScreen(rx, ry, rw, rh) - defer robotgo.FreeBitmap(bit1) - // bitmap.Save(bit1, "test2.png") - robotgo.Save(robotgo.ToImage(bit1), "test2.png") - - clo := robotgo.GetPixelColor(robotx, roboty) - fmt.Println("GetPixelColor...", clo) -} diff --git a/examples/screen/main.go b/examples/screen/main.go deleted file mode 100644 index 6ea37f8..0000000 --- a/examples/screen/main.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2016 The go-vgo Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// https://github.com/go-vgo/robotgo/blob/master/LICENSE -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -package main - -import ( - "fmt" - "strconv" - - "github.com/go-vgo/robotgo" - // "go-vgo/robotgo" -) - -func bitmap() { - bit := robotgo.CaptureScreen() - defer robotgo.FreeBitmap(bit) - fmt.Println("abitMap...", bit) - - gbit := robotgo.ToBitmap(bit) - fmt.Println("bitmap...", gbit.Width) - - gbitMap := robotgo.CaptureGo() - fmt.Println("Go CaptureScreen...", gbitMap.Width) - // fmt.Println("...", gbitmap.Width, gbitmap.BytesPerPixel) - // robotgo.SaveCapture("saveCapture.png", 10, 20, 100, 100) - - img := robotgo.CaptureImg() - robotgo.Save(img, "save.png") - - num := robotgo.DisplaysNum() - for i := 0; i < num; i++ { - robotgo.DisplayID = i - img1 := robotgo.CaptureImg() - path1 := "save_" + strconv.Itoa(i) - robotgo.Save(img1, path1+".png") - robotgo.SaveJpeg(img1, path1+".jpeg", 50) - - img2 := robotgo.CaptureImg(10, 10, 20, 20) - path2 := "test_" + strconv.Itoa(i) - robotgo.Save(img2, path2+".png") - robotgo.SaveJpeg(img2, path2+".jpeg", 50) - } -} - -func color() { - // 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) - clostr := robotgo.PadHex(clo) - fmt.Println("color...", clostr) - - rgb := robotgo.RgbToHex(255, 100, 200) - rgbstr := robotgo.PadHex(robotgo.U32ToHex(rgb)) - fmt.Println("rgb...", rgbstr) - - hex := robotgo.HexToRgb(uint32(rgb)) - fmt.Println("hex...", hex) - hexh := robotgo.PadHex(robotgo.U8ToHex(hex)) - fmt.Println("HexToRgb...", hexh) - - // gets the pixel color at 10, 20. - color2 := robotgo.GetPixelColor(10, 20) - fmt.Println("color---", color2) -} - -func screen() { - //////////////////////////////////////////////////////////////////////////////// - // Read the screen - //////////////////////////////////////////////////////////////////////////////// - - bitmap() - - // gets the screen width and height - sx, sy := robotgo.GetScreenSize() - fmt.Println("get screen size: ", sx, sy) - for i := 0; i < robotgo.DisplaysNum(); i++ { - s1 := robotgo.ScaleF(i) - fmt.Println("ScaleF: ", s1) - } - sx, sy = robotgo.GetScaleSize() - fmt.Println("get screen scale size: ", sx, sy) - - color() -} - -func main() { - screen() -} diff --git a/examples/window/main.go b/examples/window/main.go deleted file mode 100644 index 5d63145..0000000 --- a/examples/window/main.go +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright 2016 The go-vgo Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// https://github.com/go-vgo/robotgo/blob/master/LICENSE -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -package main - -import ( - "fmt" - - "github.com/go-vgo/robotgo" - // "go-vgo/robotgo" -) - -func alert() { - // show Alert Window - abool := robotgo.Alert("hello", "robotgo") - if abool { - fmt.Println("ok@@@", "ok") - } - robotgo.Alert("hello", "robotgo", "Ok", "Cancel") -} - -func get() { - // get the current process id - pid := robotgo.GetPid() - fmt.Println("pid----", pid) - - // get current Window Active - mdata := robotgo.GetActive() - - // get current Window Handle - hwnd := robotgo.GetHandle() - fmt.Println("hwnd---", hwnd) - - // get current Window title - title := robotgo.GetTitle() - fmt.Println("title-----", title) - - // set Window Active - robotgo.SetActive(mdata) -} - -func findIds() { - // find the process id by the process name - fpid, err := robotgo.FindIds("Google") - if err != nil { - fmt.Println(err) - return - } - - if len(fpid) > 0 { - robotgo.KeyTap("a", fpid[0]) - robotgo.TypeStr("Hi galaxy!", fpid[0]) - - robotgo.KeyToggle("a", fpid[0], "cmd") - robotgo.KeyToggle("a", fpid[0], "cmd", "up") - } - - fmt.Println("pids...", fpid) - if len(fpid) > 0 { - err = robotgo.ActivePid(fpid[0]) - if err != nil { - fmt.Println(err) - } - - tl := robotgo.GetTitle(fpid[0]) - fmt.Println("pid[0] title is: ", tl) - - x, y, w, h := robotgo.GetBounds(fpid[0]) - fmt.Println("GetBounds is: ", x, y, w, h) - - // Windows - // hwnd := robotgo.FindWindow("google") - // hwnd := robotgo.GetHWND() - robotgo.MinWindow(fpid[0]) - robotgo.MaxWindow(fpid[0]) - robotgo.CloseWindow(fpid[0]) - - robotgo.Kill(fpid[0]) - } -} - -func active() { - robotgo.ActivePid(100) - // robotgo.Sleep(2) - robotgo.ActiveName("code") - robotgo.Sleep(1) - robotgo.ActiveName("chrome") -} - -func findName() { - // find the process name by the process id - name, err := robotgo.FindName(100) - if err == nil { - fmt.Println("name: ", name) - } - - // find the all process name - names, err := robotgo.FindNames() - if err == nil { - fmt.Println("name: ", names) - } - - p, err := robotgo.FindPath(100) - if err == nil { - fmt.Println("path: ", p) - } -} - -func ps() { - // determine whether the process exists - isExist, err := robotgo.PidExists(100) - if err == nil && isExist { - fmt.Println("pid exists is", isExist) - - robotgo.Kill(100) - } - - // get the all process id - pids, err := robotgo.Pids() - if err == nil { - fmt.Println("pids: ", pids) - } - - // get the all process struct - ps, err := robotgo.Process() - if err == nil { - fmt.Println("process: ", ps) - } -} - -func window() { - //////////////////////////////////////////////////////////////////////////////// - // Window Handle - //////////////////////////////////////////////////////////////////////////////// - - alert() - // - get() - - findIds() - active() - - findName() - // - ps() - - // close current Window - robotgo.CloseWindow() -} - -func main() { - window() -} diff --git a/img.go b/img.go index 62ec5f6..1eacada 100644 --- a/img.go +++ b/img.go @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -package robotgo +package keyboard import ( "image" diff --git a/key.go b/key.go index 98c5342..7f7193f 100644 --- a/key.go +++ b/key.go @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -package robotgo +package keyboard /* // #include "key/keycode.h" diff --git a/keycode.go b/keycode.go index 4b9e934..33f4cc4 100644 --- a/keycode.go +++ b/keycode.go @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -package robotgo +package keyboard import ( "github.com/vcaesar/keycode" diff --git a/ps.go b/ps.go index cba6f1b..456b069 100644 --- a/ps.go +++ b/ps.go @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -package robotgo +package keyboard import ps "github.com/vcaesar/gops" diff --git a/robot_info_test.go b/robot_info_test.go index 93a9eb3..fc17751 100644 --- a/robot_info_test.go +++ b/robot_info_test.go @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -package robotgo_test +package keyboard_test import ( "fmt" diff --git a/robotgo.go b/robotgo.go index f4660ac..fdec832 100644 --- a/robotgo.go +++ b/robotgo.go @@ -27,7 +27,7 @@ Otherwise, to install the robotgo package, run the command: go get -u github.com/go-vgo/robotgo */ -package robotgo +package keyboard /* #cgo darwin CFLAGS: -x objective-c -Wno-deprecated-declarations diff --git a/robotgo_adb.go b/robotgo_adb.go index ef00db4..02bd998 100644 --- a/robotgo_adb.go +++ b/robotgo_adb.go @@ -1 +1 @@ -package robotgo +package keyboard diff --git a/robotgo_android.go b/robotgo_android.go index ef00db4..02bd998 100644 --- a/robotgo_android.go +++ b/robotgo_android.go @@ -1 +1 @@ -package robotgo +package keyboard diff --git a/robotgo_fn_v1.go b/robotgo_fn_v1.go index 89cacf9..6fb5b43 100644 --- a/robotgo_fn_v1.go +++ b/robotgo_fn_v1.go @@ -1,4 +1,4 @@ -package robotgo +package keyboard import "github.com/vcaesar/tt" diff --git a/robotgo_mac.go b/robotgo_mac.go index 0d8ac31..2a1c372 100644 --- a/robotgo_mac.go +++ b/robotgo_mac.go @@ -11,7 +11,7 @@ //go:build darwin // +build darwin -package robotgo +package keyboard /* #include diff --git a/robotgo_mac_unix.go b/robotgo_mac_unix.go index 72ad4ec..2640b88 100644 --- a/robotgo_mac_unix.go +++ b/robotgo_mac_unix.go @@ -11,7 +11,7 @@ //go:build !windows // +build !windows -package robotgo +package keyboard // ScaleF get the system scale val func ScaleF(displayId ...int) float64 { diff --git a/robotgo_mac_win.go b/robotgo_mac_win.go index ec31e58..31db83b 100644 --- a/robotgo_mac_win.go +++ b/robotgo_mac_win.go @@ -11,7 +11,7 @@ //go:build darwin || windows // +build darwin windows -package robotgo +package keyboard // GetBounds get the window bounds func GetBounds(pid int, args ...int) (int, int, int, int) { diff --git a/robotgo_ocr.go b/robotgo_ocr.go index b931a85..327b7cb 100644 --- a/robotgo_ocr.go +++ b/robotgo_ocr.go @@ -11,7 +11,7 @@ //go:build ocr // +build ocr -package robotgo +package keyboard import ( "github.com/otiai10/gosseract" diff --git a/robotgo_test.go b/robotgo_test.go index 82d0e9e..b633144 100644 --- a/robotgo_test.go +++ b/robotgo_test.go @@ -11,7 +11,7 @@ //go:build darwin || windows // +build darwin windows -package robotgo +package keyboard import ( "testing" diff --git a/robotgo_win.go b/robotgo_win.go index e99823c..521d567 100644 --- a/robotgo_win.go +++ b/robotgo_win.go @@ -11,7 +11,7 @@ //go:build windows // +build windows -package robotgo +package keyboard import ( "syscall" diff --git a/robotgo_x11.go b/robotgo_x11.go index 97aa915..d888b49 100644 --- a/robotgo_x11.go +++ b/robotgo_x11.go @@ -11,7 +11,7 @@ //go:build !darwin && !windows // +build !darwin,!windows -package robotgo +package keyboard import ( "errors" diff --git a/screen.go b/screen.go index e6b7a16..f63c5f1 100644 --- a/screen.go +++ b/screen.go @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -package robotgo +package keyboard import ( "image" diff --git a/wayland_n.go b/wayland_n.go index bc07c4d..43a156c 100644 --- a/wayland_n.go +++ b/wayland_n.go @@ -1,2 +1,2 @@ // +bulid linux,next -package robotgo +package keyboard diff --git a/windows_n.go b/windows_n.go index 613fb79..e27ab76 100644 --- a/windows_n.go +++ b/windows_n.go @@ -1,2 +1,2 @@ // +bulid windows,next -package robotgo +package keyboard