Skip to content
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

Dragsmooth does not work but Drag does sometimes. #653

Open
a13x212 opened this issue Apr 29, 2024 · 1 comment
Open

Dragsmooth does not work but Drag does sometimes. #653

a13x212 opened this issue Apr 29, 2024 · 1 comment

Comments

@a13x212
Copy link

a13x212 commented Apr 29, 2024

  • Robotgo version (or commit ref): v0.110.1
  • Go version: go version go1.22.2 darwin/arm64
  • Gcc version: 15
  • Operating system and bit: Sonoma 14.4.1 (23E224)
  • Resolution: 1728 x 1117
package main

import (
	"github.com/go-vgo/robotgo"
)

func main() {

	robotgo.Sleep(2)
	var sleep = 500
	robotgo.Move(900, 560)
	robotgo.MilliSleep(sleep)
	robotgo.Toggle("left")
	robotgo.MilliSleep(sleep)
	// robotgo.Drag(600, 560)
	robotgo.DragSmooth(600, 560)
	robotgo.MilliSleep(sleep)
	robotgo.Toggle("left", "up")
}

Description

DragSmooth will move the mouse correctly but doesn’t seem like it toggles down.

Commenting out robotgo.DragSmooth(600, 560) and enabling robotgo.Drag(600, 560) does work correctly.

Running robotgo.Drag in a for loop only works the first time.

@a13x212 a13x212 changed the title Dragsmooth does not work but Drag does. Dragsmooth does not work but Drag does sometimes. Apr 29, 2024
@Underscore76
Copy link

Just a guess for drag smooth: If you check the DragSmooth function in robotgo.go, it toggles the mouse left and then calls MoveSmooth which creates a mouse move event and not a drag event in mouse/mouse_c.h, which for MacOS will be the wrong event type generated for Quartz (guessing this doesn't matter on other platforms?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants