Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Rob
    @Deisun
    Can anyone help me with the robotgo library? Having trouble when doing "go get github.com/go-vgo/robotgo". I think I don't have something setup correctly and can't figure out what.
    vz
    @vcaesar
    Ok,what is the problem?
    jg8481
    @jg8481
    Hello. I have some hopefully quick questions. By the way, robotgo is amazing. Thank you for creating this :) I was wondering about robotgo's "FindBitmap" feature. Will it eventually have similar capabilities as Sikuli's "Find"? http://sikulix-2014.readthedocs.io/en/latest/region.html#Region.find
    vz
    @vcaesar
    Ok, Find an image on screen and read pixels from an image will be update. Until it is really reasonable, FindBitmap is failing now.
    jg8481
    @jg8481
    Ok thanks for the info. :)
    Anton Södergren
    @AAAton
    Hi! Thanks for a nice library. Is it possible to watch multiple events at the same time? I can only get one to work with go routines. Maybe I have misunderstood the syntax
    ThereWeGo
    @ThereWeGo
    hello
    is anyone here?
    maybe, i found a bug
    about TypeString()
    i have wirte an issue , maybe you can see it after wake up
    windzhu0514
    @windzhu0514
    how can i build linux executables on windows that used tobotgo
    i build success on windows but when i set GOOS=linux there is a error says no buildable Go source files
    vz
    @vcaesar
    Because dependent on cgo and zlib/libpng, cross-platform compilation is difficult.
    张山海
    @zhangshanhai
    _NSConcreteGlobalBlock

    command-line-arguments

    github.com/go-vgo/robotgo(DATA/const): unexpected reloc for dynamic symbol _NSConcreteGlobalBlock
    cocotyty
    @cocotyty
    cannot free bitmap ,no method provide
    loop call CaptureScreen will ...
    vz
    @vcaesar
    Ok, I will consider increasing the api.
    Gou.EZ
    @gouez
    hello ,There is way to listener all keyboard input event?
    Can anyone help me?
    Dan
    @DanielRenne
    How can I convert the CaptureScreen() or BCaptureScreen() into a golang []byte. Alternatively something that implements the image.Image interface.
    Georg Steyn
    @GeorgSteyn
    Hello. Any suggestion on how to click on the centre of the bitmap?
    I would assume Open Bitmap -> Get Size -> Calculate centre -> Click centre
    Florian Frouin
    @trash-anger
    Hi !
    Is there a way to use robotgo on a headless server only to use the keyboard inputs ?
    1angly
    @1angly
    Hi here ! Does anyone know how to cross compile (archlinux to windows) it's not really clear and i'm lost with x86_64-w64-mingw32-gcc
    I don't even know if it possible with robotgo
    Thanks !
    Connor Jarvis
    @ConnorJarvis
    Hey is this active?
    Cauê Felchar
    @cauefcr
    Hello everyone, i'm trying to help the project out a bit, I made some changes to the project event hooking API
    i've commited my current changes htmk/robotgo@6575f93
    Is there any reason why the hook can't be kept active? in other words, can the dispatch function be kept running?
    Ryan Sullivan
    @KayoticSully
    Hello! Before I open an issue I just wanted to check and make sure I didn't miss anything. I can not seem to get input working on macOS Mojave. I understand its beta and may not be supported. I'm checking to see if that's the case or if there are some pitfalls to getting input working on macOS. Move(x,y) TypeString() etc are not working. I can read values from the screen, get mouse position, etc just fine. Seems like anything dealing with Input does not work. The application is not crashing or anything like that. Just nothing happens. Is this to be expected? Or could this be a compatibility issue with the new os?
    Ryan Sullivan
    @KayoticSully
    I found that by compiling the program and running it normally macOS give you the "Terminal wants to control your computer" prompt to allow the mouse/keyboard takeover. Only issue is when running it with go run while developing this does not seem to work.
    Ryan Sullivan
    @KayoticSully
    Nvm I just had to enable iTerm2 as well in the security panel
    yb3616
    @yb3616
    Is there anything like "mouse up" and "mouse down" events ?
    吴彬彬
    @wuyueCreator

    For the hotkey monitoring implementation I want to use goroutine+AddEvents/AddEvent

    Example code:

    package main
    
    import (
        "fmt"
        "github.com/go-vgo/robotgo"
        "time"
    )
    
    func main() {
        go addKeysListen("q", "ctrl")
        go addKeyListen("k")
        for {
            // do something
            time.Sleep(time.Millisecond * 50)
        }
    }
    
    func addKeysListen(key string, arr ...string) {
        for {
            if ok := robotgo.AddEvents(key, arr...); ok {
                fmt.Println("pressed Ctrl + q")
            }
        }
    }
    
    func addKeyListen(key string) {
        for {
            if ok := robotgo.AddEvent(key); ok {
                fmt.Println("Pressed k")
            }
        }
    }

    If I only listen to a hotkey, it is ok, but more than one will fail.
    Can you change the underlying code to support this type of writing? Or has a more elegant solution?

    github:clipboard recorder.

    Cauê Felchar
    @cauefcr
    i recomend everyone to use the async event listener and do some switches instead of the addevent interface, it's more elegant and feature-full
    Lansana Camara
    @lansana
    How can I specify a tolerance for Bitmap?
    Everything I try fails with a panic
    Carlos Armando
    @InfeCtlll3
    hey, is there a way to convert from[]byte to C.MMBitmapRef ?
    Aquarian-Age
    @Aquarian-Age
    go get -u -v github.com/go-vgo/robotgo
    github.com/go-vgo/robotgo (download)
    github.com/go-vgo/robotgo/vendor/github.com/robotn/gohook
    # github.com/go-vgo/robotgo/vendor/github.com/robotn/gohook
    In file included from ./event/pub.h:20:0,
    from ./event/goEvent.h:18,
    from go_work/src/github.com/go-vgo/robotgo/vendor/github.com/robotn/gohook/hook.go:22:
    ./event/../hook/x11/input_c.h:39:10: fatal error: xkbcommon/xkbcommon.h: No such file or directory
    #include <xkbcommon/xkbcommon.h>
    ^~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    ---+------------------------------+-----------------------------------------------------+---------
    | libxkbcommon | Library for handling xkb descriptions | 源代码包
    i+ | libxkbcommon-devel | Development files for the libxkbcommon library | 软件包
    | libxkbcommon-devel-32bit | Development files for the libxkbcommon library | 软件包
    i+ | libxkbcommon-x11-0 | Library for handling xkb descriptions using XKB-X11 | 软件包
    i+ | libxkbcommon-x11-0-32bit | Library for handling xkb descriptions using XKB-X11 | 软件包
    i+ | libxkbcommon-x11-devel | Development files for the libxkbcommon-x11 library | 软件包
    | libxkbcommon-x11-devel-32bit | Development files for the libxkbcommon-x11 library | 软件包
    i+ | libxkbcommon0 | Library for handling xkb descriptions | 软件包
    i+ | libxkbcommon0-32bit | Library for handling xkb descriptions | 软件包
    ~
    EnochTheWise
    @EnochTheWise
    Hi, i have cross compilation error:
    $ GOOS=windows GOARCH=386 go build -o sendkey.exe sendkey.go
    # github.com/go-vgo/robotgo
    ../../github.com/go-vgo/robotgo/keycode.go:14:16: undefined: Map
    ../../github.com/go-vgo/robotgo/keycode.go:25:15: undefined: Map
    ../../github.com/go-vgo/robotgo/robotgo_mac_win.go:22:9: undefined: internalGetBounds
    ../../github.com/go-vgo/robotgo/robotgo_mac_win.go:31:12: undefined: cgetTitle
    ../../github.com/go-vgo/robotgo/robotgo_mac_win.go:45:2: undefined: internalActive

    How can i fix it?

    Code:

    ```
    package main

    import (
    "fmt"
    "os"
    "os/signal"
    "syscall"
    "time"
    "math/rand"
    "github.com/go-vgo/robotgo"
    )

    // SetupCloseHandler creates a 'listener' on a new goroutine which will notify the
    // program if it receives an interrupt from the OS. We then handle this by calling
    // our clean up procedure and exiting the program.
    func SetupCloseHandler() {
    c := make(chan os.Signal, 2)
    signal.Notify(c, os.Interrupt, syscall.SIGTERM)
    go func() {
    <-c
    fmt.Println("\r- Ctrl+C pressed in Terminal")
    os.Exit(0)
    }()
    }

    func main() {
    // Setup our Ctrl+C handler
    SetupCloseHandler()

    fmt.Println("\r- Press Ctrl+C to interrupt")

    // Run our program...
    for {
    rand.Seed(time.Now().UnixNano())
    min := 120
    max := 480
    sleep_secs := rand.Intn(max - min + 1) + min

    fmt.Println("\r- Type key and sleep: ", sleep_secs, "sec's")
    robotgo.ActiveName("KWrite")
    robotgo.TypeString("Hello World")
    robotgo.KeyTap("space")
    time.Sleep(time.Duration(sleep_secs) * time.Second)
    }
    }
    ```