From 722feb7ba3d0dd0e8e67ea06b6baa14d4826f166 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Mon, 13 Nov 2023 09:23:29 -0800 Subject: [PATCH 1/7] Update: update readme.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7dadb850..7f9c6cc7 100644 --- a/README.md +++ b/README.md @@ -70,12 +70,12 @@ xcode-select --install #### For Windows: -[MinGW-w64](https://sourceforge.net/projects/mingw-w64/files) (Use recommended) +[MinGW-w64](https://sourceforge.net/projects/mingw-w64/files) (Use recommended) or others Mingw [llvm-mingw](https://github.com/mstorsjo/llvm-mingw) Download the Mingw, then set system environment variables `C:\mingw64\bin` to the Path. [Set environment variables to run GCC from command line](https://www.youtube.com/results?search_query=Set+environment+variables+to+run+GCC+from+command+line). -`Or the other GCC (But you should compile the "libpng" with yourself when use the bitmap.)` +`Or the other GCC` (But you should compile the "libpng" with yourself when use the [bitmap](https://github.com/vcaesar/bitmap).) #### For everything else: From e2f5f54804441097eec769e124fb015f588d5dfd Mon Sep 17 00:00:00 2001 From: vcaesar Date: Mon, 13 Nov 2023 10:22:10 -0800 Subject: [PATCH 2/7] Update: update readme.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7f9c6cc7..70a90089 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [![Build Status](https://travis-ci.org/go-vgo/robotgo.svg)](https://travis-ci.org/go-vgo/robotgo) ![Appveyor](https://ci.appveyor.com/api/projects/status/github/go-vgo/robotgo?branch=master&svg=true) [![Go Report Card](https://goreportcard.com/badge/github.com/go-vgo/robotgo)](https://goreportcard.com/report/github.com/go-vgo/robotgo) -[![GoDoc](https://godoc.org/github.com/go-vgo/robotgo?status.svg)](https://godoc.org/github.com/go-vgo/robotgo) +[![GoDoc](https://pkg.go.dev/badge/github.com/go-vgo/robotgo?status.svg)](https://pkg.go.dev/github.com/go-vgo/robotgo?tab=doc) [![GitHub release](https://img.shields.io/github/release/go-vgo/robotgo.svg)](https://github.com/go-vgo/robotgo/releases/latest) [![Join the chat at https://gitter.im/go-vgo/robotgo](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/go-vgo/robotgo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) @@ -62,7 +62,7 @@ GCC #### For MacOS: -Xcode Command Line Tools (And Privacy setting: [#277](https://github.com/go-vgo/robotgo/issues/277) ) +Xcode Command Line Tools (And Privacy setting: [#277](https://github.com/go-vgo/robotgo/issues/277)) ``` xcode-select --install @@ -70,7 +70,7 @@ xcode-select --install #### For Windows: -[MinGW-w64](https://sourceforge.net/projects/mingw-w64/files) (Use recommended) or others Mingw [llvm-mingw](https://github.com/mstorsjo/llvm-mingw) +[MinGW-w64](https://sourceforge.net/projects/mingw-w64/files) (Use recommended) or others Mingw [llvm-mingw](https://github.com/mstorsjo/llvm-mingw); Download the Mingw, then set system environment variables `C:\mingw64\bin` to the Path. [Set environment variables to run GCC from command line](https://www.youtube.com/results?search_query=Set+environment+variables+to+run+GCC+from+command+line). @@ -87,9 +87,9 @@ X11 with the XTest extension (the Xtst library) "Clipboard": xsel xclip -"Bitmap": libpng (Just used by the bitmap.) +"Bitmap": libpng (Just used by the "bitmap".) -"Event": xcb, xkb, libxkbcommon (Just used by the hook.) +"Event-Gohook": xcb, xkb, libxkbcommon (Just used by the "hook".) ``` @@ -109,7 +109,7 @@ sudo apt install xsel xclip # Bitmap sudo apt install libpng++-dev -# Hook +# GoHook sudo apt install xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev libxkbcommon-dev ``` From 61b77ce3e12501317424b4dfabf07eaf3d9b8a94 Mon Sep 17 00:00:00 2001 From: sleep2144985 Date: Wed, 20 Dec 2023 17:35:11 +0800 Subject: [PATCH 3/7] fix: x11 capslock reference the wrong constant --- key/keycode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/key/keycode.h b/key/keycode.h index 4a6771ac..d5577faa 100644 --- a/key/keycode.h +++ b/key/keycode.h @@ -179,7 +179,7 @@ enum _MMKeyCode { K_SHIFT = XK_Shift_L, K_LSHIFT = XK_Shift_L, K_RSHIFT = XK_Shift_R, - K_CAPSLOCK = XK_Shift_Lock, + K_CAPSLOCK = XK_Caps_Lock, K_SPACE = XK_space, K_INSERT = XK_Insert, K_PRINTSCREEN = XK_Print, From 39818d41fa898f2378d55099cbed12a627e6bbf3 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Wed, 20 Dec 2023 09:52:51 -0800 Subject: [PATCH 4/7] Add: add next Linux and Windows files --- .circleci/images/primary/Dockerfile | 2 +- README.md | 2 +- wayland_n.go | 2 ++ windows_n.go | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 wayland_n.go create mode 100644 windows_n.go diff --git a/.circleci/images/primary/Dockerfile b/.circleci/images/primary/Dockerfile index bc83ff92..0cc660ac 100644 --- a/.circleci/images/primary/Dockerfile +++ b/.circleci/images/primary/Dockerfile @@ -1,5 +1,5 @@ # FROM golang:1.10.1 -FROM golang:1.20.3-stretch AS build +FROM golang:1.21.5-stretch AS build # FROM govgo/go:1.11.1 RUN apt update && apt install -y --no-install-recommends \ diff --git a/README.md b/README.md index 70a90089..763b6bb7 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ sudo dnf install xsel xclip # Bitmap sudo dnf install libpng-devel -# Hook +# GoHook sudo dnf install libxkbcommon-devel libxkbcommon-x11-devel xorg-x11-xkb-utils-devel ``` diff --git a/wayland_n.go b/wayland_n.go new file mode 100644 index 00000000..bc07c4d1 --- /dev/null +++ b/wayland_n.go @@ -0,0 +1,2 @@ +// +bulid linux,next +package robotgo diff --git a/windows_n.go b/windows_n.go new file mode 100644 index 00000000..613fb790 --- /dev/null +++ b/windows_n.go @@ -0,0 +1,2 @@ +// +bulid windows,next +package robotgo From e9421b58b67250feb987463bb115592921820f50 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Fri, 23 Feb 2024 08:47:11 -0800 Subject: [PATCH 5/7] Update: bump CI to newest --- .circleci/config.yml | 2 +- .circleci/images/primary/Dockerfile | 2 +- appveyor.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5b490fa1..544556f8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: docker: # using custom image, see .circleci/images/primary/Dockerfile # - image: govgo/robotgoci:1.10.3 - - image: golang:1.21.0 + - image: golang:1.22.0 working_directory: /gopath/src/github.com/go-vgo/robotgo steps: - checkout diff --git a/.circleci/images/primary/Dockerfile b/.circleci/images/primary/Dockerfile index 0cc660ac..b9618cdb 100644 --- a/.circleci/images/primary/Dockerfile +++ b/.circleci/images/primary/Dockerfile @@ -1,5 +1,5 @@ # FROM golang:1.10.1 -FROM golang:1.21.5-stretch AS build +FROM golang:1.21.7-stretch AS build # FROM govgo/go:1.11.1 RUN apt update && apt install -y --no-install-recommends \ diff --git a/appveyor.yml b/appveyor.yml index 67a5d86a..ae1d56e9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -34,7 +34,7 @@ environment: PATH: C:\msys64\mingw32\bin\;C:\Program Files (x86)\NSIS\;%PATH% # - COMPILER: MINGW_W64 # ARCHITECTURE: x64 - GOVERSION: 1.21.0 + GOVERSION: 1.22.0 # GOPATH: c:\gopath # scripts that run after cloning repository From 3171c5bdff584a84abde8fc4ea46d06b82a38bc3 Mon Sep 17 00:00:00 2001 From: nzlov Date: Sun, 7 Apr 2024 14:08:26 +0800 Subject: [PATCH 6/7] fix: DragSmooth Repeat Call MoveScale `DragSmooth` calls `MoveScale` followed by `MoveSmooth`, and `MoveSmooth` calls `MoveScale` within `MoveSmooth`, resulting in duplicate calls to `MoveScale`. --- robotgo.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/robotgo.go b/robotgo.go index b445a8fd..f4660ac8 100644 --- a/robotgo.go +++ b/robotgo.go @@ -540,8 +540,6 @@ func Drag(x, y int, args ...string) { // // robotgo.DragSmooth(10, 10) func DragSmooth(x, y int, args ...interface{}) { - x, y = MoveScale(x, y) - Toggle("left") MilliSleep(50) MoveSmooth(x, y, args...) From 05c54c6f259c2366673744796152396774597204 Mon Sep 17 00:00:00 2001 From: rustfix <771054535@qq.com> Date: Mon, 15 Apr 2024 11:37:14 +0800 Subject: [PATCH 7/7] chore: fix function names in comment Signed-off-by: rustfix <771054535@qq.com> --- robotgo_win.go | 2 +- robotgo_x11.go | 2 +- screen.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/robotgo_win.go b/robotgo_win.go index d2208bca..e99823c2 100644 --- a/robotgo_win.go +++ b/robotgo_win.go @@ -57,7 +57,7 @@ func SetForeg(hwnd win.HWND) bool { return win.SetForegroundWindow(hwnd) } -// GetMian get the main display hwnd +// GetMain get the main display hwnd func GetMain() win.HWND { return win.GetActiveWindow() } diff --git a/robotgo_x11.go b/robotgo_x11.go index 26355a18..97aa9151 100644 --- a/robotgo_x11.go +++ b/robotgo_x11.go @@ -190,7 +190,7 @@ func DisplaysNum() int { return int(reply.Number) } -// GetMianId get the main display id +// GetMainId get the main display id func GetMainId() int { conn, err := xgb.NewConn() if err != nil { diff --git a/screen.go b/screen.go index e0eca41e..e6b7a16f 100644 --- a/screen.go +++ b/screen.go @@ -16,13 +16,13 @@ import ( "github.com/kbinani/screenshot" ) -// GetScreenBound gets the display screen bounds +// GetDisplayBounds gets the display screen bounds func GetDisplayBounds(i int) (x, y, w, h int) { bs := screenshot.GetDisplayBounds(i) return bs.Min.X, bs.Min.Y, bs.Dx(), bs.Dy() } -// GetDisplayBounds gets the display rect +// GetDisplayRect gets the display rect func GetDisplayRect(i int) Rect { x, y, w, h := GetDisplayBounds(i) return Rect{