Code Monkey home page Code Monkey logo

robotgo's Introduction

Robotgo

Build Status CircleCI Status Build Status Appveyor Go Report Card GoDoc GitHub release Join the chat at https://gitter.im/go-vgo/robotgo

Golang Desktop Automation. Control the mouse, keyboard, read the screen, process, Window Handle, image and bitmap and global event listener.

RobotGo supports Mac, Windows, and Linux(X11); and robotgo supports arm64 and x86-amd64.

Contents

Docs

Binding:

ADB, packaging android adb API.

Robotn, binding JavaScript and other, support more language.

Requirements:

Now, Please make sure Golang, GCC is installed correctly before installing RobotGo.

ALL:

Golang

GCC

For MacOS:

Xcode Command Line Tools (And Privacy setting: #277)

xcode-select --install

For Windows:

MinGW-w64 (Use recommended) or others Mingw llvm-mingw;

Download the Mingw, then set system environment variables C:\mingw64\bin to the Path. Set environment variables to run GCC from command line.

Or the other GCC (But you should compile the "libpng" with yourself when use the bitmap.)

For everything else:

GCC

X11 with the XTest extension (the Xtst library)

"Clipboard": xsel xclip


"Bitmap": libpng (Just used by the "bitmap".)

"Event-Gohook": xcb, xkb, libxkbcommon (Just used by the "hook".)

Ubuntu:
# gcc
sudo apt install gcc libc6-dev

# x11
sudo apt install libx11-dev xorg-dev libxtst-dev

# Clipboard
sudo apt install xsel xclip

#
# Bitmap
sudo apt install libpng++-dev

# GoHook
sudo apt install xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev libxkbcommon-dev
Fedora:
# x11
sudo dnf install libXtst-devel

# Clipboard
sudo dnf install xsel xclip

#
# Bitmap
sudo dnf install libpng-devel

# GoHook
sudo dnf install libxkbcommon-devel libxkbcommon-x11-devel xorg-x11-xkb-utils-devel

Installation:

With Go module support (Go 1.11+), just import:

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

Otherwise, to install the robotgo package, run the command:

go get github.com/go-vgo/robotgo

png.h: No such file or directory? Please see issues/47.

Update:

go get -u github.com/go-vgo/robotgo

Note go1.10.x C file compilation cache problem, golang #24355. go mod vendor problem, golang #26366.

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")
}
package main

import (
  "fmt"

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

func main() {
  robotgo.TypeStr("Hello World")
  robotgo.TypeStr("だんしゃり", 0, 1)
  // robotgo.TypeStr("テストする")

  robotgo.TypeStr("Hi, Seattle space needle, Golden gate bridge, One world trade center.")
  robotgo.TypeStr("Hi galaxy, hi stars, hi MT.Rainier, hi sea. こんにちは世界.")
  robotgo.Sleep(1)

  // ustr := uint32(robotgo.CharCodeAt("Test", 0))
  // robotgo.UnicodeType(ustr)

  robotgo.KeySleep = 100
  robotgo.KeyTap("enter")
  // robotgo.TypeStr("en")
  robotgo.KeyTap("i", "alt", "cmd")

  arr := []string{"alt", "cmd"}
  robotgo.KeyTap("i", arr)

  robotgo.MilliSleep(100)
  robotgo.KeyToggle("a")
  robotgo.KeyToggle("a", "up")

  robotgo.WriteAll("Test")
  text, err := robotgo.ReadAll()
  if err == nil {
    fmt.Println(text)
  }
}
package main

import (
  "fmt"

  "github.com/go-vgo/robotgo"
  "github.com/vcaesar/imgo"
)

func main() {
  x, y := robotgo.Location()
  fmt.Println("pos: ", x, y)

  color := robotgo.GetPixelColor(100, 200)
  fmt.Println("color---- ", color)

  sx, sy := robotgo.GetScreenSize()
  fmt.Println("get screen size: ", sx, sy)

  bit := robotgo.CaptureScreen(10, 10, 30, 30)
  defer robotgo.FreeBitmap(bit)

  img := robotgo.ToImage(bit)
  imgo.Save("test.png", img)

  num := robotgo.DisplaysNum()
  for i := 0; i < num; i++ {
    robotgo.DisplayID = i
    img1 := robotgo.CaptureImg()
    path1 := "save_" + strconv.Itoa(i)
    robotgo.Save(img1, path1+".png")
    robotgo.SaveJpeg(img1, path1+".jpeg", 50)

    img2 := robotgo.CaptureImg(10, 10, 20, 20)
    robotgo.Save(img2, "test_"+strconv.Itoa(i)+".png")
  }
}
package main

import (
  "fmt"

  "github.com/go-vgo/robotgo"
  "github.com/vcaesar/bitmap"
)

func main() {
  bit := robotgo.CaptureScreen(10, 20, 30, 40)
  // use `defer robotgo.FreeBitmap(bit)` to free the bitmap
  defer robotgo.FreeBitmap(bit)

  fmt.Println("bitmap...", bit)
  img := robotgo.ToImage(bit)
  // robotgo.SavePng(img, "test_1.png")
  robotgo.Save(img, "test_1.png")

  bit2 := robotgo.ToCBitmap(robotgo.ImgToBitmap(img))
  fx, fy := bitmap.Find(bit2)
  fmt.Println("FindBitmap------ ", fx, fy)
  robotgo.Move(fx, fy)

  arr := bitmap.FindAll(bit2)
  fmt.Println("Find all bitmap: ", arr)

  fx, fy = bitmap.Find(bit)
  fmt.Println("FindBitmap------ ", fx, fy)

  bitmap.Save(bit, "test.png")
}
package main

import (
  "fmt"
  "math/rand"

  "github.com/go-vgo/robotgo"
  "github.com/vcaesar/gcv"
  "github.com/vcaesar/bitmap"
)

func main() {
  opencv()
}

func opencv() {
  name := "test.png"
  name1 := "test_001.png"
  robotgo.SaveCapture(name1, 10, 10, 30, 30)
  robotgo.SaveCapture(name)

  fmt.Print("gcv find image: ")
  fmt.Println(gcv.FindImgFile(name1, name))
  fmt.Println(gcv.FindAllImgFile(name1, name))

  bit := bitmap.Open(name1)
  defer robotgo.FreeBitmap(bit)
  fmt.Print("find bitmap: ")
  fmt.Println(bitmap.Find(bit))

  // bit0 := robotgo.CaptureScreen()
  // img := robotgo.ToImage(bit0)
  // bit1 := robotgo.CaptureScreen(10, 10, 30, 30)
  // img1 := robotgo.ToImage(bit1)
  // defer robotgo.FreeBitmapArr(bit0, bit1)
  img := robotgo.CaptureImg()
  img1 := robotgo.CaptureImg(10, 10, 30, 30)

  fmt.Print("gcv find image: ")
  fmt.Println(gcv.FindImg(img1, img))
  fmt.Println()

  res := gcv.FindAllImg(img1, img)
  fmt.Println(res[0].TopLeft.Y, res[0].Rects.TopLeft.X, res)
  x, y := res[0].TopLeft.X, res[0].TopLeft.Y
  robotgo.Move(x, y-rand.Intn(5))
  robotgo.MilliSleep(100)
  robotgo.Click()

  res = gcv.FindAll(img1, img) // use find template and sift
  fmt.Println("find all: ", res)
  res1 := gcv.Find(img1, img)
  fmt.Println("find: ", res1)

  img2, _, _ := robotgo.DecodeImg("test_001.png")
  x, y = gcv.FindX(img2, img)
  fmt.Println(x, y)
}
package main

import (
  "fmt"

  // "github.com/go-vgo/robotgo"
  hook "github.com/robotn/gohook"
)

func main() {
  add()
  low()
  event()
}

func add() {
  fmt.Println("--- Please press ctrl + shift + q to stop hook ---")
  hook.Register(hook.KeyDown, []string{"q", "ctrl", "shift"}, func(e hook.Event) {
    fmt.Println("ctrl-shift-q")
    hook.End()
  })

  fmt.Println("--- Please press w---")
  hook.Register(hook.KeyDown, []string{"w"}, func(e hook.Event) {
    fmt.Println("w")
  })

  s := hook.Start()
  <-hook.Process(s)
}

func low() {
	evChan := hook.Start()
	defer hook.End()

	for ev := range evChan {
		fmt.Println("hook: ", ev)
	}
}

func event() {
  ok := hook.AddEvents("q", "ctrl", "shift")
  if ok {
    fmt.Println("add events...")
  }

  keve := hook.AddEvent("k")
  if keve {
    fmt.Println("you press... ", "k")
  }

  mleft := hook.AddEvent("mleft")
  if mleft {
    fmt.Println("you press... ", "mouse left button")
  }
}
package main

import (
  "fmt"

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

func main() {
  fpid, err := robotgo.FindIds("Google")
  if err == nil {
    fmt.Println("pids... ", fpid)

    if len(fpid) > 0 {
      robotgo.TypeStr("Hi galaxy!", fpid[0])
      robotgo.KeyTap("a", fpid[0], "cmd")

      robotgo.KeyToggle("a", fpid[0])
      robotgo.KeyToggle("a", fpid[0], "up")

      robotgo.ActivePid(fpid[0])

      robotgo.Kill(fpid[0])
    }
  }

  robotgo.ActiveName("chrome")

  isExist, err := robotgo.PidExists(100)
  if err == nil && isExist {
    fmt.Println("pid exists is", isExist)

    robotgo.Kill(100)
  }

  abool := robotgo.Alert("test", "robotgo")
  if abool {
 	  fmt.Println("ok@@@ ", "ok")
  }

  title := robotgo.GetTitle()
  fmt.Println("title@@@ ", title)
}

Authors

Plans

  • Refactor some C code to Go (such as x11, windows)
  • Better multiscreen support
  • Wayland support
  • Update Window Handle
  • Try to support Android and IOS

Contributors

License

Robotgo is primarily distributed under the terms of "both the MIT license and the Apache License (Version 2.0)", with portions covered by various BSD-like licenses.

See LICENSE-APACHE, LICENSE-MIT.

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

菜鸟求教软件运行问题

`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变量给方法传参数?

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

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, 小键盘这些如果操作?

v0.10.0

1.Optimized memory recovery

2.Fix bug

linux input

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

linux system

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?

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

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

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")

}

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

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 ?

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.

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
...

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

...

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

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

v0.30.0

1.Fix bug
2.Bitmap3
3.Window Handle

v0.50.0

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

v0.40.0

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

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)

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.

您好!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.20.0

1.bitmap2

2.fix bug

3.event

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.

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.