-
Notifications
You must be signed in to change notification settings - Fork 898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
robotgo.Move moves cursor to invalid position on multi-monitor setup #479
Comments
I will check it. |
Fixed in beta5.1, and not support multi screen in Windows now. |
New test: Setup:
Code: package main
import (
"github.com/go-vgo/robotgo"
"fmt"
)
func main() {
// Setup: 3 1920x1080 screens - middle one is primary
moveTo(0, 0) // middle screen
moveTo(10, 100) // middle screen
moveTo(-1900, 100) // left screen
moveTo(1930, 100) // right screen
}
func moveTo(x int, y int) {
robotgo.Move(x, y)
robotgo.MilliSleep(100)
x, y = robotgo.GetMousePos()
fmt.Println(x, y)
robotgo.MilliSleep(900)
} Result:
Well, something did change ( Side note: I have taskbar on the right monitor. Windows considers anything to the left or up from primary screen to be in negative position. However, when image search is done, it takes a screenshot and returns position of found image within the screenshot, which cannot be negative. At least this is how I think it works as far I tested it all. Not directly related to the issue, but this is something to consider. |
meet with the same issue in multi-screen scene |
have any plan to support mutiscreen on windows and fix this? |
Maybe I've found the reason and fixed it. |
v1.0.0-beta5
go version go1.17.6 windows/amd64
gcc.exe (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0
(recommended by README)Windows 10 64bit
Description
robotgo.Move
moves cursor to absolute X, Y position that is passed to the function.robotgo.GetMousePos
returns position of the cursor, which used immediately afterrobotgo.Move
should be exactly the same, assuming no user input.Since
robotgo.Move
moves cursor to invalid location sincerobotgo@v1.0.0-beta1
, at least on multi-monitor setup like my own - 3 monitors with 1920x1080 resolution, middle one being set as primary/main, therefore starting with X 0, Y 0, and the left one has negative X positions.Same code tested with other versions:
Aside from X being affected, you can see that Y is off by one.
The text was updated successfully, but these errors were encountered: