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

Add more key and mouse examples and Update CI
This commit is contained in:
Evans 2022-04-14 09:00:22 -07:00 committed by GitHub
commit 8ba7338861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 7 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.17.8
- image: golang:1.18.1
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.17.8-stretch AS build
FROM golang:1.18.1-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.17.8
GOVERSION: 1.18.1
# GOPATH: c:\gopath
# scripts that run after cloning repository

View File

@ -74,6 +74,14 @@ func keyTap() {
robotgo.KeyTap("a", "control")
}
func special() {
robotgo.TypeStr("{}")
robotgo.KeyTap("[", "]")
robotgo.KeyToggle("(")
robotgo.KeyToggle("(", "up")
}
func keyToggle() {
// robotgo.KeySleep = 150
robotgo.KeyToggle(robotgo.KeyA)
@ -113,6 +121,7 @@ func key() {
////////////////////////////////////////////////////////////////////////////////
typeStr()
special()
keyTap()
keyToggle()

View File

@ -25,9 +25,7 @@ func move() {
// move the mouse to 100, 200
robotgo.Move(100, 200)
// robotgo.Drag(10, 10)
// robotgo.Drag(20, 20, "right")
//
// drag mouse with smooth
robotgo.DragSmooth(10, 10)
robotgo.DragSmooth(100, 200, 1.0, 100.0)
@ -37,7 +35,7 @@ func move() {
robotgo.MoveSmoothRelative(10, -100, 1.0, 30.0)
for i := 0; i < 1080; i += 1000 {
fmt.Println(i)
fmt.Println("i: ", i)
// MoveMouse(800, i)
robotgo.Move(800, i)
}
@ -74,6 +72,9 @@ func toggleAndScroll() {
robotgo.Scroll(100, 10)
robotgo.Scroll(0, -10)
robotgo.Toggle("left")
robotgo.Toggle("left", "up")
// toggles the right mouse button
robotgo.Toggle("right")
robotgo.Toggle("right", "up")