gotomation

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

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

Go to latest
Published: Apr 29, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

README

Gotomation
============

Automation library like ``java.awt.Robot``.

Document
----------

https://godoc.org/github.com/shibukawa/gotomation

License
--------

Apache-2

Known Issue
-----------

* Mouse coursor moving is not working on VirtualBox host OS with mouse cursor integration.
* Windows: mouse cursor moving is not working (I tested on Windows 10 Pro on VirtualBox)
* X11: String typing is not implemented. In future, I will add this only for cgo environment.
  XCB (and xgb - golang version) doesn't support ``XStringToKeysym()`` equivalent function.

Thanks
------

* https://github.com/BurntSushi/xgb

  It uses ``xgb`` for X11 environment.

* https://github.com/go-vgo/robotgo

  This code is inspired by robotogo. I rewrite into pure go, add utf-8 support etc as much as possible.

Documentation

Overview

Package gotomation is cross-platform system automation library.

Index

Constants

View Source
const (
	SHIFT   KeyModifier = 0x0001
	ALT                 = 0x0002
	CONTROL             = 0x0004
	META                = 0x0008
	WIN                 = META
	COMMAND             = META
)
View Source
const (
	MouseLeft   MouseButton = 1
	MouseCenter             = 2
	MouseRight              = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyCode

type KeyCode uint16

type KeyModifier

type KeyModifier uint16

type Keyboard

type Keyboard interface {
	SetTypeSpeed(charPerMin int)
	TypeSpeed() int
	KeyPress(code KeyCode, modifiers ...KeyModifier) error
	KeyDown(code KeyCode, modifiers ...KeyModifier) error
	KeyUp(code KeyCode, modifiers ...KeyModifier) error
	Type(str string) error
	TypeQuickly(str string) error
}

type Mouse

type Mouse interface {
	GetPosition() (x, y int)
	Move(x, y int, duration time.Duration) error
	MoveQuickly(x, y int) error
	Click() error
	ClickWith(button MouseButton) error
	DoubleClick() error
	DoubleClickWith(button MouseButton) error
	Drag(x, y int) error
	DragWith(button MouseButton, x, y int) error
	Scroll(x, y int, duration time.Duration) error
}

type MouseButton

type MouseButton int

type Screen

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

func (Screen) Capture

func (s Screen) Capture() (image.Image, error)

func (Screen) CaptureRegion

func (s Screen) CaptureRegion(rect image.Rectangle) (image.Image, error)

func (Screen) Close

func (s Screen) Close()

func (Screen) H

func (s Screen) H() int

func (Screen) ID

func (s Screen) ID() int

func (Screen) Keyboard

func (s Screen) Keyboard() Keyboard

func (Screen) Mouse

func (s Screen) Mouse() Mouse

func (Screen) RawCapture

func (s Screen) RawCapture() (image.Image, error)

func (Screen) RawCaptureRegion

func (s Screen) RawCaptureRegion(rect image.Rectangle) (image.Image, error)

func (Screen) W

func (s Screen) W() int

func (Screen) X

func (s Screen) X() int

func (Screen) Y

func (s Screen) Y() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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