mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
Merge pull request #551 from go-vgo/bitmap-pr
Add: add cmd to the ctrl supported
This commit is contained in:
commit
c9e1c3db67
@ -5,7 +5,7 @@ jobs:
|
|||||||
docker:
|
docker:
|
||||||
# using custom image, see .circleci/images/primary/Dockerfile
|
# using custom image, see .circleci/images/primary/Dockerfile
|
||||||
# - image: govgo/robotgoci:1.10.3
|
# - 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
|
working_directory: /gopath/src/github.com/go-vgo/robotgo
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# FROM golang:1.10.1
|
# 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
|
# FROM govgo/go:1.11.1
|
||||||
|
|
||||||
RUN apt update && apt install -y --no-install-recommends \
|
RUN apt update && apt install -y --no-install-recommends \
|
||||||
|
@ -34,7 +34,7 @@ environment:
|
|||||||
PATH: C:\msys64\mingw32\bin\;C:\Program Files (x86)\NSIS\;%PATH%
|
PATH: C:\msys64\mingw32\bin\;C:\Program Files (x86)\NSIS\;%PATH%
|
||||||
# - COMPILER: MINGW_W64
|
# - COMPILER: MINGW_W64
|
||||||
# ARCHITECTURE: x64
|
# ARCHITECTURE: x64
|
||||||
GOVERSION: 1.19.3
|
GOVERSION: 1.19.4
|
||||||
# GOPATH: c:\gopath
|
# GOPATH: c:\gopath
|
||||||
|
|
||||||
# scripts that run after cloning repository
|
# scripts that run after cloning repository
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go-vgo/robotgo/clipboard"
|
"github.com/go-vgo/robotgo/clipboard"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
out, err := ioutil.ReadAll(os.Stdin)
|
out, err := io.ReadAll(os.Stdin)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
9
key.go
9
key.go
@ -322,6 +322,15 @@ var keyNames = map[string]C.MMKeyCode{
|
|||||||
// { NULL: C.K_NOT_A_KEY }
|
// { 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
|
// It sends a key press and release to the active application
|
||||||
func tapKeyCode(code C.MMKeyCode, flags C.MMKeyFlags, pid C.uintptr) {
|
func tapKeyCode(code C.MMKeyCode, flags C.MMKeyFlags, pid C.uintptr) {
|
||||||
C.toggleKeyCode(code, true, flags, pid)
|
C.toggleKeyCode(code, true, flags, pid)
|
||||||
|
Loading…
Reference in New Issue
Block a user