airinput

package
v0.0.0-...-7a52318 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2015 License: MIT Imports: 17 Imported by: 0

README

go-airinput

Rotation

airinput.ROTATION_0,
airinput.ROTATION_90,
airinput.ROTATION_180,
airinput.ROTATION_270

Indicate rotation

rotation

Documentation

Index

Constants

View Source
const (
	ROTATION_0 = iota
	ROTATION_90
	ROTATION_180
	ROTATION_270
	ROTATION_UNKNOWN
)
View Source
const DEV_FB0 = "/dev/graphics/fb0"

Variables

View Source
var SCRBUFLEN int

Functions

func CoordRotate

func CoordRotate(x, y int) (nx, ny int)

About: 0.03s Rotate coordinate to rotation_0 Anticlockwise

func Debug

func Debug(state bool)

Wether show debug info

func Drag

func Drag(startX, startY int, endX, endY int, steps int, duration time.Duration)

Drag form A to B

func GetRawSize

func GetRawSize(event string) (width, height int, err error)

func GuessTouchpad

func GuessTouchpad() (p string, err error)

func GuessTouchpadByName

func GuessTouchpadByName() (p string, err error)

func Init

func Init(tpdEvent string) (err error)

Have to be call before other func if tpdEvent == "", it will auto guess

func Move

func Move(x, y int)

func Pinch

func Pinch(Ax0, Ay0, Ax1, Ay1 int,
	Bx0, By0, Bx1, By1 int, steps int, duration time.Duration)

This is like two drag Can implements like shrink and magnify

func Press

func Press(x, y int)

func Release

func Release()

func Rotation

func Rotation() int

return 0,1,2,3

func ScreenSize

func ScreenSize() (width int, height int, err error)

Refrerence code of python-adbviewclient

func ScreenSize2

func ScreenSize2() (w, h int)

Use ioctl Got error some times

func Snapshot

func Snapshot() (img *image.RGBA, err error)

Snapshot by cmd: /system/bin/screencap Not Rotated

func Snapshot2

func Snapshot2() *image.RGBA

Snapshot of android phone (by read /dev/fb0) Only ok with few phones, a lot of phone will got blank image.

func SnapshotRotated

func SnapshotRotated() (dst *image.RGBA, err error)

func Tap

func Tap(x, y int, duration time.Duration)

Tap position for some time

Types

This section is empty.

Jump to

Keyboard shortcuts

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