From f4f4a3d319056902802de6d65449f095f6432244 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Sat, 10 Dec 2022 15:50:41 -0800 Subject: [PATCH 1/2] Update: Update CI --- .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 55be1d92..6bf42fea 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 7b15f841..01b48c93 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 1e8bb1ca..c667add4 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 From e8b397520516585ce04bc17279a6370a048de24d Mon Sep 17 00:00:00 2001 From: vcaesar Date: Thu, 15 Dec 2022 08:58:17 -0800 Subject: [PATCH 2/2] Add: add cmd to the ctrl supported --- clipboard/cmd/gocopy/gocopy.go | 4 ++-- key.go | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/clipboard/cmd/gocopy/gocopy.go b/clipboard/cmd/gocopy/gocopy.go index 115672af..aaa9c30b 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 f0b37a80..998452e5 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)