mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
Merge pull request #498 from go-vgo/bitmap-pr
Add more key and mouse examples and Update CI
This commit is contained in:
commit
8ba7338861
@ -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.17.8
|
- image: golang:1.18.1
|
||||||
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.17.8-stretch AS build
|
FROM golang:1.18.1-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.17.8
|
GOVERSION: 1.18.1
|
||||||
# GOPATH: c:\gopath
|
# GOPATH: c:\gopath
|
||||||
|
|
||||||
# scripts that run after cloning repository
|
# scripts that run after cloning repository
|
||||||
|
@ -74,6 +74,14 @@ func keyTap() {
|
|||||||
robotgo.KeyTap("a", "control")
|
robotgo.KeyTap("a", "control")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func special() {
|
||||||
|
robotgo.TypeStr("{}")
|
||||||
|
robotgo.KeyTap("[", "]")
|
||||||
|
|
||||||
|
robotgo.KeyToggle("(")
|
||||||
|
robotgo.KeyToggle("(", "up")
|
||||||
|
}
|
||||||
|
|
||||||
func keyToggle() {
|
func keyToggle() {
|
||||||
// robotgo.KeySleep = 150
|
// robotgo.KeySleep = 150
|
||||||
robotgo.KeyToggle(robotgo.KeyA)
|
robotgo.KeyToggle(robotgo.KeyA)
|
||||||
@ -113,6 +121,7 @@ func key() {
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
typeStr()
|
typeStr()
|
||||||
|
special()
|
||||||
|
|
||||||
keyTap()
|
keyTap()
|
||||||
keyToggle()
|
keyToggle()
|
||||||
|
@ -25,9 +25,7 @@ func move() {
|
|||||||
// move the mouse to 100, 200
|
// move the mouse to 100, 200
|
||||||
robotgo.Move(100, 200)
|
robotgo.Move(100, 200)
|
||||||
|
|
||||||
// robotgo.Drag(10, 10)
|
// drag mouse with smooth
|
||||||
// robotgo.Drag(20, 20, "right")
|
|
||||||
//
|
|
||||||
robotgo.DragSmooth(10, 10)
|
robotgo.DragSmooth(10, 10)
|
||||||
robotgo.DragSmooth(100, 200, 1.0, 100.0)
|
robotgo.DragSmooth(100, 200, 1.0, 100.0)
|
||||||
|
|
||||||
@ -37,7 +35,7 @@ func move() {
|
|||||||
robotgo.MoveSmoothRelative(10, -100, 1.0, 30.0)
|
robotgo.MoveSmoothRelative(10, -100, 1.0, 30.0)
|
||||||
|
|
||||||
for i := 0; i < 1080; i += 1000 {
|
for i := 0; i < 1080; i += 1000 {
|
||||||
fmt.Println(i)
|
fmt.Println("i: ", i)
|
||||||
// MoveMouse(800, i)
|
// MoveMouse(800, i)
|
||||||
robotgo.Move(800, i)
|
robotgo.Move(800, i)
|
||||||
}
|
}
|
||||||
@ -74,6 +72,9 @@ func toggleAndScroll() {
|
|||||||
robotgo.Scroll(100, 10)
|
robotgo.Scroll(100, 10)
|
||||||
robotgo.Scroll(0, -10)
|
robotgo.Scroll(0, -10)
|
||||||
|
|
||||||
|
robotgo.Toggle("left")
|
||||||
|
robotgo.Toggle("left", "up")
|
||||||
|
|
||||||
// toggles the right mouse button
|
// toggles the right mouse button
|
||||||
robotgo.Toggle("right")
|
robotgo.Toggle("right")
|
||||||
robotgo.Toggle("right", "up")
|
robotgo.Toggle("right", "up")
|
||||||
|
Loading…
Reference in New Issue
Block a user