Skip to content

Commit 47abfac

Browse files
authored
Merge pull request #716 from go-vgo/bitmap-pr
Fixed: fixed windows Scale #713 and Update readme.md
2 parents 0343215 + df0731c commit 47abfac

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ GCC
6161
```
6262

6363
#### For MacOS:
64+
```
65+
brew install go
66+
```
6467

6568
Xcode Command Line Tools (And Privacy setting: [#277](https://github.com/go-vgo/robotgo/issues/277))
6669

@@ -69,8 +72,15 @@ xcode-select --install
6972
```
7073

7174
#### For Windows:
75+
```
76+
winget install Golang.go
77+
```
78+
79+
```
80+
winget install MartinStorsjo.LLVM-MinGW.UCRT
81+
```
7282

73-
[MinGW-w64](https://sourceforge.net/projects/mingw-w64/files) (Use recommended) or others Mingw [llvm-mingw](https://github.com/mstorsjo/llvm-mingw);
83+
Or [MinGW-w64](https://sourceforge.net/projects/mingw-w64/files) (Use recommended) or others Mingw [llvm-mingw](https://github.com/mstorsjo/llvm-mingw);
7484

7585
Download the Mingw, then set system environment variables `C:\mingw64\bin` to the Path.
7686
[Set environment variables to run GCC from command line](https://www.youtube.com/results?search_query=Set+environment+variables+to+run+GCC+from+command+line).
@@ -96,6 +106,9 @@ X11 with the XTest extension (the Xtst library)
96106
##### Ubuntu:
97107

98108
```yml
109+
# sudo apt install golang
110+
sudo snap install go --classic
111+
99112
# gcc
100113
sudo apt install gcc libc6-dev
101114

@@ -165,11 +178,18 @@ Note go1.10.x C file compilation cache problem, [golang #24355](https://github.c
165178
package main
166179

167180
import (
181+
"fmt"
168182
"github.com/go-vgo/robotgo"
169183
)
170184

171185
func main() {
172-
robotgo.MouseSleep = 100
186+
robotgo.MouseSleep = 300
187+
188+
robotgo.Move(100, 100)
189+
fmt.Println(robotgo.Location())
190+
robotgo.Move(100, -200) // multi screen supported
191+
robotgo.MoveSmooth(120, -150)
192+
fmt.Println(robotgo.Location())
173193

174194
robotgo.ScrollDir(10, "up")
175195
robotgo.ScrollDir(20, "right")

robotgo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ func CheckMouse(btn string) C.MMMouseButton {
506506

507507
// MoveScale calculate the os scale factor x, y
508508
func MoveScale(x, y int, displayId ...int) (int, int) {
509-
if Scale && runtime.GOOS == "windows" {
509+
if Scale || runtime.GOOS == "windows" {
510510
f := ScaleF()
511511
x, y = Scaled1(x, f), Scaled1(y, f)
512512
}
@@ -630,7 +630,7 @@ func Location() (int, int) {
630630
x := int(pos.x)
631631
y := int(pos.y)
632632

633-
if runtime.GOOS == "windows" {
633+
if Scale || runtime.GOOS == "windows" {
634634
f := ScaleF()
635635
x, y = Scaled0(x, f), Scaled0(y, f)
636636
}

0 commit comments

Comments
 (0)