Giter VIP home page Giter VIP logo

robotgo's People

Contributors

aep avatar anatawa12 avatar dependabot[bot] avatar gramnani-crest avatar hi20160616 avatar huybuidev avatar iepathos avatar jraby avatar konstantinkuklin avatar ldemailly avatar nzlov avatar prashantgupta24 avatar rocket049 avatar rustfix avatar sleep2144985 avatar t4o2m0 avatar testwill avatar vcaesar avatar vinhjaxt avatar wang35666 avatar wilon avatar xxxserxxx avatar yms2772 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

robotgo's Issues

Event example: free(): invalid size: 0x0000000001d43ab0

Description

Getting error when pressing k in the Event example.

The packages were different than mentioned for Ubuntu in README.md

Installed missing packages:

$ sudo dnf install libxkbcommon-devel libXtst-devel libxkbcommon-x11-devel xorg-x11-xkb-utils-devel

Windows you can use w32 instead of cgo....

You can load windows API for all of the work you are doing for windows. This would make it more Pure-Go.

Check out github.com/AllenDang/w32 its a great package with almost everything.

FindBitmap is unsuccessful

        fmt.Println("capture screen: 10, 20, 30, 40")
	bit_map := robotgo.CaptureScreen(10, 20, 30, 40)
	fmt.Println("...", bit_map)
	fx, fy := robotgo.FindBitmap(bit_map, 0, 0, 100, 100)
	fmt.Println("FindBitmap------", fx, fy)

capture screen: 10, 20, 30, 40
... &{0x2f7180 30 40 120 32 4 [2 66 192 0 0 0]}
FindBitmap------ 5584104 4542714

v0.20.0

1.bitmap2

2.fix bug

3.event

菜鸟求教软件运行问题

`package main

import (
. "fmt"

"github.com/go-vgo/robotgo"

)

func main() {
robotgo.MoveMouse(800, 0)

for i := 0; i < 1080; i += 1000 {
    Println(i)
    robotgo.MoveMouse(800, i)
}

}
提示错误.\main.go:14: cannot use i (type int) as type robotgo._Ctype_size_t in argument to robotgo.MoveMouse`
请问.MoveMouse(x, y)的参数为什么不设为int类型?
在循环里面没有办法直接使用int变量给方法传参数?

linux input

load_input: Unknown keycode name 'evdev_aliases(qwerty)'!

linux system

TypeString Bug

今天新装的系统 ,环境版本都是最新的,主要TypeString存在问题

  1. TypeString(str) str首字母必须大写, 否则无限输出第一个字母
  2. TypeString 不输出中文

e.g.
robotgo.TypeString("hello xxx") // hhhhhhhhhhhhhhhhh endless robotgo.TypeString("E水电费水电费") // output: E without chinese

键盘事件问题

1,按键事件监听,如何取消原按键动作,比如代码写上,比如要用A替换K时,当键盘按下K,达到键盘的实际输入是A,原来的K被取消
2,F1, ESC, 小键盘这些如果操作?

code optimize

  • Code reuse
  • Performance optimize
  • Reduce the code
  • Optimize api and performance

robotgo编译失败

no buildable Go source files in /usr/lib/go-1.6/src/github.com/go-vgo/robotgo

v0.30.0

1.Fix bug
2.Bitmap3
3.Window Handle

build error in windows

I was trying to build "go-vgo/robotgo" library .

I have followed each step like downloading "mingw"(32bit) and adding "zlib,pnglib" from zlib&libpng Windows32 GCC's Course as stated. but when i try to get it from cmd using this command,

go get github.com/go-vgo/robotgo

it shows a enormous list of error.

Can anyone help me please. I am using windows 10 (64 bit) and go 1.7.3 (x86).

Errors copied from the cmd is given below,

G:\ProgramFiles\Go32>go get github.com/go-vgo/robotgo
github.com/go-vgo/robotgo In file included from
./mouse/goMouse.h:12:0,
from src\github.com\go-vgo\robotgo\robotgo.go:24: ./mouse/mouse_c.h: In function 'moveMouse': ./mouse/mouse_c.h:116:2:
error: unknown type name 'INPUT' ./mouse/mouse_c.h:117:12: error:
request for member 'type' in something not a structure or union
./mouse/mouse_c.h:117:20: error: 'INPUT_MOUSE' undeclared (first use
in this function) ./mouse/mouse_c.h:117:20: note: each undeclared
...

run 'go get github.com/go-vgo/robotgo ' failed on macos

/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:56:91: error: expected a type

  • (void)executeWithArguments:(nullable NSArray<NSString *> *)arguments completionHandler:(nullable NSUserUnixTaskCompletionHandler)handler;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:71:32: error: expected a type
  • (void)executeWithAppleEvent:(nullable NSAppleEventDescriptor *)event completionHandler:(nullable NSUserAppleScriptTaskCompletionHandler)handler;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:71:91: error: expected a type
  • (void)executeWithAppleEvent:(nullable NSAppleEventDescriptor *)event completionHandler:(nullable NSUserAppleScriptTaskCompletionHandler)handler;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:85:12: error: unknown property attribute 'nullable'
    @Property (nullable, copy) NSDictionary<NSString *, id> *variables;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:85:50: error: expected '>'
    @Property (nullable, copy) NSDictionary<NSString *, id> *variables;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:85:51: error: expected member name or ';' after declaration specifiers
    @Property (nullable, copy) NSDictionary<NSString *, id> *variables;
    ~~~~~~~~~~~~ ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:85:1: error: property requires fields to be named
    @Property (nullable, copy) NSDictionary<NSString *, id> *variables;
    ^ ~~~~~~~~~~~~~~~~~~~~~~~
    /System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:85:53: error: interface type cannot be statically allocated
    @Property (nullable, copy) NSDictionary<NSString *, id> *variables;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:85:55: error: expected ';' at end of declaration list
    @Property (nullable, copy) NSDictionary<NSString *, id> *variables;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:85:55: error: expected identifier or '('
    /System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:89:27: error: expected a type
  • (void)executeWithInput:(nullable id )input completionHandler:(nullable NSUserAutomatorTaskCompletionHandler)handler;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:89:81: error: expected a type
  • (void)executeWithInput:(nullable id )input completionHandler:(nullable NSUserAutomatorTaskCompletionHandler)handler;
    ^
    In file included from ../github.com/go-vgo/robotgo/robotgo.go:38:
    In file included from ./key/goKey.h:14:
    In file included from ./key/keypress_c.h:1:
    In file included from ./key/keypress.h:6:
    In file included from ./key/keycode.h:14:
    In file included from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:29:
    In file included from /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/HIToolbox.h:240:
    In file included from /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/IMKInputSession.h:23:
    In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:175:
    /System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:13:62: error: expected ';' after @Class
    @Class NSMutableDictionary, NSString, NSOperationQueue, NSSet, NSLock, NSError;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:13:63: error: cannot find protocol declaration for 'ObjectType'
    @Class NSMutableDictionary, NSString, NSOperationQueue, NSSet, NSLock, NSError;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:13:74: error: expected identifier or '('
    @Class NSMutableDictionary, NSString, NSOperationQueue, NSSet, NSLock, NSError;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:64:12: error: unknown property attribute 'nullable'
    @Property (nullable, readonly, copy) NSString *serviceName;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:74:12: error: unknown property attribute 'nullable'
    @Property (nullable, retain) NSXPCInterface *exportedInterface;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:77:12: error: unknown property attribute 'nullable'
    @Property (nullable, retain) id exportedObject;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:80:12: error: unknown property attribute 'nullable'
    @Property (nullable, retain) NSXPCInterface *remoteObjectInterface;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:89:12: error: unknown property attribute 'nullable'
    @Property (nullable, copy) void (^interruptionHandler)(void);
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:94:12: error: unknown property attribute 'nullable'
    @Property (nullable, copy) void (^invalidationHandler)(void);
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:138:12: error: unknown property attribute 'nullable'
    @Property (nullable, assign) id delegate;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:180:27: error: cannot find protocol declaration for 'Class'
  • (void)setClasses:(NSSet *)classes forSelector:(SEL)sel argumentIndex:(NSUInteger)arg ofReply:(BOOL)ofReply;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:181:10: error: cannot find protocol declaration for 'Class'
  • (NSSet *)classesForSelector:(SEL)sel argumentIndex:(NSUInteger)arg ofReply:(BOOL)ofReply;
    ^
    /System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:185:4: error: expected a type
  • (nullable NSXPCInterface *)interfaceForSelector:(SEL)sel argumentIndex:(NSUInteger)arg ofReply:(BOOL)ofReply;
    ^
    3077 errors generated.

too many arguments in call to robotgo.MouseToggle

代码如下:
package main

import (
"time"

"github.com/go-vgo/robotgo"

)

func main() {
time.Sleep(5e9)

robotgo.MoveMouse(0, 0)
robotgo.MouseToggle("down")
robotgo.DragMouse(100, 100)
robotgo.MouseToggle("up")

}

cross-platform Build

I am using Ubuntu.
Cross Compile

/github.com/go-vgo/robotgo$ GOOS=windows GOARCH=386 go build -o test.exe

Error message :
can't load package: package github.com/go-vgo/robotgo: no buildable Go source files in /home/say/golang/gowork/src/github.com/go-vgo/robotgo

Linux Cross Compile, What packages do I need ?

What ide should i run this code on?

  1. Please speak English, this is the language everybody of us can speak and write.
  2. Please ask questions or config/deploy problems on our Gitter channel: https://gitter.im/go-vgo/robotgo
  3. Please take a moment to search that an issue doesn't already exist.
  4. Please give all relevant information below for bug reports, incomplete details will be handled as an invalid report.

You MUST delete the content above including this line before posting, otherwise your issue will be invalid.

  • Robotgo version (or commit ref):
  • Go version:
  • Gcc version:
  • Operating system and bit:
  • Can you reproduce the bug at Example:
    • Yes (provide example code)
    • No
    • Not relevant
  • Provide example code:
  • Log gist:

Description

...

v0.10.0

1.Optimized memory recovery

2.Fix bug

getting error at go build -v

I'm getting this error on circle-ci. on my local machine everything works just fine.

go build -v
github.com/Sirupsen/logrus
github.com/girish946/robotgo
github.com/gorilla/context
github.com/gorilla/mux
# github.com/girish946/robotgo
In file included from event/goEvent.h:25:0,
                 from /home/ubuntu/.go_workspace/src/github.com/girish946/robotgo/robotgo.go:27:
event/hook/x11/hook_c.h: In function 'hook_event_proc':
event/hook/x11/hook_c.h:357:5: error: 'for' loop initial declarations are only allowed in C99 mode
     for (unsigned int i = 0; i < count; i++) {
     ^
event/hook/x11/hook_c.h:357:5: note: use option -std=c99 or -std=gnu99 to compile your code

go build -v returned exit code 2

Action failed: go build

what should I do for this?

v0.50.0

  1. Update Window Handle
  2. Fix bug
  3. Update Bitmap

Input focus event

Hi there, thanks for great lib.

I wonder if there is any way to handle focus event when entering text field? For example, after "clicking" mouse check whether active window waiting for input...
I'm not familiar with this all things, sorry if question is weird.

Bitmap and libpng

I compile libpng (windows 64)
Where i shoud put png.h for correct work?
Now I put png.h in %GOPATH%/src/github.com/go-vgo

But robotgo.FindBitmap dont work correct? the sample for bitmap work like this:
... &{0x2a9690 30 40 120 32 4 [3 66 192 0 0 0]} FindBitmap------ 1 1

hookrun: Accessibility API is disabled!

  • Robotgo version (or commit ref): latest

  • Go version: go1.7.3 darwin/amd64

  • Gcc version:Apple LLVM version 8.0.0 (clang-800.0.42.1)

  • Operating system and bit:OS X El Capitan

  • Provide example code:
    same as event demo
    https://github.com/go-vgo/robotgo#event

  • Log gist:

hook_run [1329]: Accessibility API is disabled!
Failed to enable access for assistive devices. (0X40)hook_run [1329]: Accessibility API is disabled!
Failed to enable access for assistive devices. (0X40)

XIO: fatal IO error when showAlert()

package main

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

func main() {
	abool := robotgo.ShowAlert("test", "robotgo")
	if abool == 0 {
		Println("ok@@@", "ok")
	}
}

$ go run client.go 
XIO:  fatal IO error 2 (No such file or directory) on X server ":0.0"
      after 11 requests (11 known processed) with 0 events remaining.

os:Archlinux
gcc: 6.2.1 20160830

您好!ERROR

github.com/go-vgo/robotgo

github.com/go-vgo/robotgo

In file included from ./bitmap/../base/io_init.h:4:0,
from ./bitmap/goBitmap.h:15,
from ..\github.com\go-vgo\robotgo\robotgo.go:16:
./bitmap/../base/png_io_init.h:4:17: fatal error: png.h: No such file or directory
compilation terminated.
错误: 进程退出代码 2.

v0.40.0

1.Fix bug
2.Bitmap3
3.Window-Handle2
4.Update Mosue

Repository title

I think the current repository title could be a little better: maybe removing Golang with Go

RobotGo,Golang Native cross-platform system automation

RobotGo. Go Native cross-platform system automation

Golang is a little bit disliked. Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.