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 bc83ff92..b9618cdb 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.7-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 7dadb850..763b6bb7 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,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: @@ -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 ``` @@ -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/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 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, 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...) 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{ 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