robotgo

package module
v0.0.0-...-bbc73b0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2016 License: MIT Imports: 3 Imported by: 0

README

#Robotgo

Golang Desktop Automation(robot). Control the mouse, keyboard, and read the screen.

RobotGo supports Mac, Windows, and Linux(X11).

This is a work in progress.

##API Document    中文文档 Please click API Document;This is a work in progress.

##Installation: go get github.com/go-vgo/robotgo

It's that easy!

###Requirements:

####ALL:
Golang

####For Mac OS X: Xcode Command Line Tools ####For Windows: MinGW or other GCC ####For everything else: GCC

X11 with the XTest extension (also known as the Xtst library)

##Examples:

###Mouse

package main

import (
	//. "fmt"

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

func main() {
  robotgo.ScrollMouse(10, "up")
} 

###Keyboard

package main

import (
	//. "fmt"

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

func main() {
  robotgo.TypeString("Hello World")
  robotgo.KeyTap("enter")
  robotgo.TypeString("en")
} 

###Screen

package main

import (
	. "fmt"

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

func main() {
  x, y := robotgo.GetMousePos()
  Println("pos:", x, y)
} 

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DragMouse

func DragMouse(x, y int)

func GetMousePos

func GetMousePos() (int, int)

func GetPixelColor

func GetPixelColor(x, y int) string

func GetScreenSize

func GetScreenSize() (int, int)

func GetXDisplayName

func GetXDisplayName() string

func KeyTap

func KeyTap(args ...string)

func KeyToggle

func KeyToggle(args ...string)

func MouseClick

func MouseClick()

func MouseToggle

func MouseToggle()

func MoveMouse

func MoveMouse(x, y int)

C.size_t int

func MoveMouseSmooth

func MoveMouseSmooth(x, y int)

func ScrollMouse

func ScrollMouse(x int, y string)

func SetKeyboardDelay

func SetKeyboardDelay(x int)

func SetMouseDelay

func SetMouseDelay(x int)

func SetMouseSpeed

func SetMouseSpeed(low, high float64)

func SetXDisplayName

func SetXDisplayName(name string) string

func Try

func Try(fun func(), handler func(interface{}))
_  __          _                         _

| |/ /___ _ _| |__ ___ __ _ _ __ __| | | ' // _ \ | | | '_ \ / _ \ / _` | '__/ _` | | . \ __/ |_| | |_) | (_) | (_| | | | (_| | |_|\_\___|\__, |_.__/ \___/ \__,_|_| \__,_|

|___/

func TypeString

func TypeString(x string)

func TypeStringDelayed

func TypeStringDelayed(x string, y int)

Types

type Bit_map

type Bit_map struct {
	ImageBuffer   *uint8
	Width         int
	Height        int
	Bytewidth     int
	BitsPerPixel  uint8
	BytesPerPixel uint8
}

func CaptureScreen

func CaptureScreen(x, y, w, h int) Bit_map

type MPoint

type MPoint struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL