diff --git a/.circleci/config.yml b/.circleci/config.yml index 55be1d9..6bf42fe 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.19.3 + - image: golang:1.19.4 working_directory: /gopath/src/github.com/go-vgo/robotgo steps: - checkout diff --git a/.circleci/images/primary/Dockerfile b/.circleci/images/primary/Dockerfile index 7b15f84..01b48c9 100644 --- a/.circleci/images/primary/Dockerfile +++ b/.circleci/images/primary/Dockerfile @@ -1,5 +1,5 @@ # FROM golang:1.10.1 -FROM golang:1.19.3-stretch AS build +FROM golang:1.19.4-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 1e8bb1c..c667add 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.19.3 + GOVERSION: 1.19.4 # GOPATH: c:\gopath # scripts that run after cloning repository diff --git a/clipboard/cmd/gocopy/gocopy.go b/clipboard/cmd/gocopy/gocopy.go index 115672a..aaa9c30 100644 --- a/clipboard/cmd/gocopy/gocopy.go +++ b/clipboard/cmd/gocopy/gocopy.go @@ -1,14 +1,14 @@ package main import ( - "io/ioutil" + "io" "os" "github.com/go-vgo/robotgo/clipboard" ) func main() { - out, err := ioutil.ReadAll(os.Stdin) + out, err := io.ReadAll(os.Stdin) if err != nil { panic(err) } diff --git a/key.go b/key.go index f0b37a8..998452e 100644 --- a/key.go +++ b/key.go @@ -322,6 +322,15 @@ var keyNames = map[string]C.MMKeyCode{ // { NULL: C.K_NOT_A_KEY } } +// CmdCtrl If the operating system is macOS, return the key string "cmd", +// otherwise return the key string "ctrl +func CmdCtrl() string { + if runtime.GOOS == "darwin" { + return "cmd" + } + return "ctrl" +} + // It sends a key press and release to the active application func tapKeyCode(code C.MMKeyCode, flags C.MMKeyFlags, pid C.uintptr) { C.toggleKeyCode(code, true, flags, pid)