Merge pull request #551 from go-vgo/bitmap-pr

Add: add cmd to the ctrl supported
This commit is contained in:
Evans 2022-12-15 09:02:13 -08:00 committed by GitHub
commit c9e1c3db67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 5 deletions

View File

@ -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

View File

@ -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 \

View File

@ -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

View File

@ -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)
}

9
key.go
View File

@ -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)