go-vgo / robotgo

RobotGo, Go Native cross-platform RPA and GUI automation @vcaesar
Apache License 2.0
9.47k stars 862 forks source link

ScrollDir is not defined #606

Closed 0xAl3xH closed 8 months ago

0xAl3xH commented 11 months ago
package main

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

func main() {
  robotgo.MouseSleep = 100

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

  robotgo.Scroll(0, -10)
  robotgo.Scroll(100, 0)

  robotgo.MilliSleep(100)
  robotgo.ScrollSmooth(-10, 6)
  // robotgo.ScrollRelative(10, -100)

  robotgo.Move(10, 20)
  robotgo.MoveRelative(0, -10)
  robotgo.DragSmooth(10, 10)

  robotgo.Click("wheelRight")
  robotgo.Click("left", true)
  robotgo.MoveSmooth(100, 200, 1.0, 10.0)

  robotgo.Toggle("left")
  robotgo.Toggle("left", "up")
}

Description

The current example code uses ScrollDir which is not defined in v0.100.10 of this library which is the default installed version. The example code should force v1.x or take our ScrollDir entirely.

as a workaround, I forced require github.com/go-vgo/robotgo v1.0.0-rc1 in go.mod

timendez commented 8 months ago

omg thank you so much! I forced that version too and it fixed my problem as well.

vcaesar commented 8 months ago

You should use this latest Released, and v0.100.10 is dropped now.

timendez commented 8 months ago

You should use this latest Released, and v0.100.10 is dropped now.

Thank you! I thought I was, but at some point digging through logs it looked like VS Code automatically downloaded a very old version. I'm up to latest released now.