Skip to content

Commit

Permalink
Merge pull request #498 from go-vgo/bitmap-pr
Browse files Browse the repository at this point in the history
Add more key and mouse examples and Update CI
  • Loading branch information
vcaesar authored Apr 14, 2022
2 parents e533734 + 7df3bc3 commit 8ba7338
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .circleci/images/primary/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions examples/key/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -113,6 +121,7 @@ func key() {
////////////////////////////////////////////////////////////////////////////////

typeStr()
special()

keyTap()
keyToggle()
Expand Down
9 changes: 5 additions & 4 deletions examples/mouse/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
}
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 8ba7338

Please sign in to comment.