mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-28 21:13:55 +00:00
Fixed: fixed windows Scale #713 and Update readme.md
This commit is contained in:
parent
6a1f060a8c
commit
df0731c4df
24
README.md
24
README.md
@ -61,6 +61,9 @@ GCC
|
||||
```
|
||||
|
||||
#### For MacOS:
|
||||
```
|
||||
brew install go
|
||||
```
|
||||
|
||||
Xcode Command Line Tools (And Privacy setting: [#277](https://github.com/go-vgo/robotgo/issues/277))
|
||||
|
||||
@ -69,8 +72,15 @@ xcode-select --install
|
||||
```
|
||||
|
||||
#### For Windows:
|
||||
```
|
||||
winget install Golang.go
|
||||
```
|
||||
|
||||
[MinGW-w64](https://sourceforge.net/projects/mingw-w64/files) (Use recommended) or others Mingw [llvm-mingw](https://github.com/mstorsjo/llvm-mingw);
|
||||
```
|
||||
winget install MartinStorsjo.LLVM-MinGW.UCRT
|
||||
```
|
||||
|
||||
Or [MinGW-w64](https://sourceforge.net/projects/mingw-w64/files) (Use recommended) or others Mingw [llvm-mingw](https://github.com/mstorsjo/llvm-mingw);
|
||||
|
||||
Download the Mingw, then set system environment variables `C:\mingw64\bin` to the Path.
|
||||
[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)
|
||||
##### Ubuntu:
|
||||
|
||||
```yml
|
||||
# sudo apt install golang
|
||||
sudo snap install go --classic
|
||||
|
||||
# gcc
|
||||
sudo apt install gcc libc6-dev
|
||||
|
||||
@ -165,11 +178,18 @@ Note go1.10.x C file compilation cache problem, [golang #24355](https://github.c
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/go-vgo/robotgo"
|
||||
)
|
||||
|
||||
func main() {
|
||||
robotgo.MouseSleep = 100
|
||||
robotgo.MouseSleep = 300
|
||||
|
||||
robotgo.Move(100, 100)
|
||||
fmt.Println(robotgo.Location())
|
||||
robotgo.Move(100, -200) // multi screen supported
|
||||
robotgo.MoveSmooth(120, -150)
|
||||
fmt.Println(robotgo.Location())
|
||||
|
||||
robotgo.ScrollDir(10, "up")
|
||||
robotgo.ScrollDir(20, "right")
|
||||
|
@ -506,7 +506,7 @@ func CheckMouse(btn string) C.MMMouseButton {
|
||||
|
||||
// MoveScale calculate the os scale factor x, y
|
||||
func MoveScale(x, y int, displayId ...int) (int, int) {
|
||||
if Scale && runtime.GOOS == "windows" {
|
||||
if Scale || runtime.GOOS == "windows" {
|
||||
f := ScaleF()
|
||||
x, y = Scaled1(x, f), Scaled1(y, f)
|
||||
}
|
||||
@ -630,7 +630,7 @@ func Location() (int, int) {
|
||||
x := int(pos.x)
|
||||
y := int(pos.y)
|
||||
|
||||
if runtime.GOOS == "windows" {
|
||||
if Scale || runtime.GOOS == "windows" {
|
||||
f := ScaleF()
|
||||
x, y = Scaled0(x, f), Scaled0(y, f)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user