robotgo

package module
v0.94.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

README

Robotgo

github.com/zuiwuchang/robotgo tailored version,only the following functions are retained:

  • mouse
  • keyboard
  • clipboard
  • screen

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Keycode = uMap{
	"`": 41,
	"1": 2,
	"2": 3,
	"3": 4,
	"4": 5,
	"5": 6,
	"6": 7,
	"7": 8,
	"8": 9,
	"9": 10,
	"0": 11,
	"-": 12,
	"+": 13,

	"q":  16,
	"w":  17,
	"e":  18,
	"r":  19,
	"t":  20,
	"y":  21,
	"u":  22,
	"i":  23,
	"o":  24,
	"p":  25,
	"[":  26,
	"]":  27,
	"\\": 43,

	"a": 30,
	"s": 31,
	"d": 32,
	"f": 33,
	"g": 34,
	"h": 35,
	"j": 36,
	"k": 37,
	"l": 38,
	";": 39,
	"'": 40,

	"z": 44,
	"x": 45,
	"c": 46,
	"v": 47,
	"b": 48,
	"n": 49,
	"m": 50,
	",": 51,
	".": 52,
	"/": 53,

	"f1":  59,
	"f2":  60,
	"f3":  61,
	"f4":  62,
	"f5":  63,
	"f6":  64,
	"f7":  65,
	"f8":  66,
	"f9":  67,
	"f10": 68,
	"f11": 69,
	"f12": 70,

	"esc":     1,
	"delete":  14,
	"tab":     15,
	"ctrl":    29,
	"control": 29,
	"alt":     56,
	"space":   57,
	"shift":   42,
	"rshift":  54,
	"enter":   28,

	"cmd":     3675,
	"command": 3675,
	"rcmd":    3676,
	"ralt":    3640,

	"up":    57416,
	"down":  57424,
	"left":  57419,
	"right": 57421,
}

Keycode robotgo hook key's code map

View Source
var MouseMap = uMap{
	"left":       1,
	"right":      2,
	"center":     3,
	"wheelDown":  4,
	"wheelUp":    5,
	"wheelLeft":  6,
	"wheelRight": 7,
}

MouseMap robotgo hook mouse's code map

Functions

func CharCodeAt

func CharCodeAt(s string, n int) rune

CharCodeAt char code at utf-8

func CheckMouse

func CheckMouse(btn string) C.MMMouseButton

CheckMouse check the mouse button

func Click

func Click(args ...interface{})

Click click the mouse

robotgo.Click(button string, double bool)

func Drag

func Drag(x, y int, args ...string)

Drag drag the mouse

func DragMouse

func DragMouse(x, y int, args ...string)

DragMouse drag the mouse

func DragSmooth

func DragSmooth(x, y int, args ...interface{})

DragSmooth drag the mouse smooth

func GetMousePos

func GetMousePos() (int, int)

GetMousePos get mouse's portion

func KeyTap

func KeyTap(tapKey string, args ...interface{}) string

KeyTap tap the keyboard code;

See keys:

https://github.com/zuiwuchang/robotgo/blob/master/docs/keys.md

func KeyToggle

func KeyToggle(key string, args ...string) string

KeyToggle toggle the keyboard

See keys:

https://github.com/zuiwuchang/robotgo/blob/master/docs/keys.md

func MicroSleep

func MicroSleep(tm float64)

MicroSleep time C.microsleep(tm)

func MilliSleep

func MilliSleep(tm int)

MilliSleep sleep tm milli second

func MouseClick

func MouseClick(args ...interface{})

MouseClick click the mouse

robotgo.MouseClick(button string, double bool)

func MouseToggle

func MouseToggle(togKey string, args ...interface{}) int

MouseToggle toggle the mouse

func Move

func Move(x, y int)

Move move the mouse

func MoveArgs

func MoveArgs(x, y int) (int, int)

MoveArgs move mose relative args

func MoveClick

func MoveClick(x, y int, args ...interface{})

MoveClick move and click the mouse

robotgo.MoveClick(x, y int, button string, double bool)

func MoveMouse

func MoveMouse(x, y int)

MoveMouse move the mouse

func MoveMouseSmooth

func MoveMouseSmooth(x, y int, args ...interface{}) bool

MoveMouseSmooth move the mouse smooth, moves mouse to x, y human like, with the mouse button up.

func MoveRelative

func MoveRelative(x, y int)

MoveRelative move mose relative

func MoveSmooth

func MoveSmooth(x, y int, args ...interface{}) bool

MoveSmooth move the mouse smooth, moves mouse to x, y human like, with the mouse button up.

robotgo.MoveSmooth(x, y int, low, high float64, mouseDelay int)

func MoveSmoothRelative

func MoveSmoothRelative(x, y int, args ...interface{})

MoveSmoothRelative move mose smooth relative

func MovesClick

func MovesClick(x, y int, args ...interface{})

MovesClick move smooth and click the mouse

func PasteStr

func PasteStr(str string) string

PasteStr paste a string, support UTF-8

func ReadAll

func ReadAll() (string, error)

ReadAll read string from clipboard

func Scroll

func Scroll(x, y int, args ...int)

Scroll scroll the mouse with x, y

robotgo.Scroll(x, y, msDelay int)

func ScrollMouse

func ScrollMouse(x int, direction string)

ScrollMouse scroll the mouse

func SetDelay

func SetDelay(d ...int)

SetDelay set the key and mouse delay

func SetKeyDelay

func SetKeyDelay(delay int)

SetKeyDelay set keyboard delay

func SetKeyboardDelay

func SetKeyboardDelay(delay int)

SetKeyboardDelay set keyboard delay, Wno-deprecated, this function will be removed in version v1.0.0

func SetMouseDelay

func SetMouseDelay(delay int)

SetMouseDelay set mouse delay

func Sleep

func Sleep(tm int)

Sleep time.Sleep tm second

func ToUC

func ToUC(text string) []string

func TypeStr

func TypeStr(str string, args ...float64)

TypeStr send a string, support UTF-8

robotgo.TypeStr(string: The string to send, float64: microsleep time, x11)

func TypeStrDelay

func TypeStrDelay(str string, delay int)

TypeStrDelay type string delayed

func TypeString

func TypeString(str string, delay ...int)

TypeString send a string, support unicode TypeStr(string: The string to send), Wno-deprecated

func TypeStringDelayed

func TypeStringDelayed(str string, delay int)

TypeStringDelayed type string delayed, Wno-deprecated

func UnicodeType

func UnicodeType(str uint32)

UnicodeType tap uint32 unicode

func WriteAll

func WriteAll(text string) error

WriteAll write string to clipboard

Types

This section is empty.

Directories

Path Synopsis
Package clipboard read/write on clipboard
Package clipboard read/write on clipboard
cmd/gocopy command
cmd/gopaste command
example command

Jump to

Keyboard shortcuts

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