Documentation
¶
Overview ¶
Package robotgo Go native cross-platform system automation.
No C compiler is required — all platform APIs are called via purego/syscall.
Installation:
With Go module support (Go 1.11+), just import:
import "github.com/shaolei/robotgo"
+bulid linux,next
+bulid windows,next
Index ¶
- Constants
- Variables
- func ActiveName(name string) error
- func ActivePid(pid int, args ...int) error
- func ActivePidC(pid int, args ...int) error
- func Alert(title, msg string, args ...string) bool
- func ByteToImg(b []byte) (image.Image, error)
- func Capture(args ...int) (*image.RGBA, error)
- func CaptureImg(args ...int) (image.Image, error)
- func CharCodeAt(s string, n int) rune
- func CheckMouse(btn string) uint16
- func Click(args ...interface{}) error
- func ClickV1(args ...interface{})
- func CloseMainDisplay()
- func CloseWindow(args ...int)
- func CmdCtrl() string
- func CmdV() error
- func DecodeImg(path string) (image.Image, string, error)
- func DisplaysNum() int
- func Drag(x, y int, args ...string)deprecated
- func DragMouse(x, y int, args ...interface{})deprecated
- func DragSmooth(x, y int, args ...interface{})
- func FindIds(name string) ([]int, error)
- func FindName(pid int) (string, error)
- func FindNames() ([]string, error)
- func FindPath(pid int) (string, error)
- func FreeBitmap(bitmap CBitmap)
- func FreeBitmapArr(bit ...CBitmap)
- func GetBHandle() intdeprecated
- func GetBounds(pid int, args ...int) (int, int, int, int)
- func GetClient(pid int, args ...int) (int, int, int, int)
- func GetDisplayBounds(i int) (x, y, w, h int)
- func GetHWNDByPid(pid int) int
- func GetHandle() int
- func GetLocationColor(displayId ...int) string
- func GetMainId() int
- func GetMousePos() (int, int)deprecated
- func GetPid() int
- func GetPixelColor(x, y int, displayId ...int) string
- func GetScaleSize(displayId ...int) (int, int)
- func GetScreenSize() (int, int)
- func GetText(imgPath string, args ...string) (string, error)
- func GetTitle(args ...int) string
- func GetVersion() string
- func GetXDisplayName() string
- func GetXid(xu *xgbutil.XUtil, pid int) (xproto.Window, error)
- func GetXidByPid(xu *xgbutil.XUtil, pid int) (xproto.Window, error)
- func GetXidFromPid(xu *xgbutil.XUtil, pid int) (xproto.Window, error)deprecated
- func GoString(char *int8) string
- func Height(img image.Image) int
- func HexToRgb(hex uint32) (r, g, b uint8)
- func ImgSize(path string) (int, int, error)
- func Is64Bit() bool
- func IsMain(displayId int) bool
- func IsValid() bool
- func KeyDown(key string, args ...interface{}) error
- func KeyPress(key string, args ...interface{}) error
- func KeyTap(key string, args ...interface{}) error
- func KeyToggle(key string, args ...interface{}) error
- func KeyUp(key string, args ...interface{}) error
- func Kill(pid int) error
- func Location() (int, int)
- func MaxWindow(pid int, args ...interface{})
- func MicroSleep(tm float64)deprecated
- func MilliSleep(tm int)
- func MinWindow(pid int, args ...interface{})
- func MouseButtonString(btn uint16) string
- func MouseClick(args ...interface{})deprecated
- func MouseDown(key ...interface{}) error
- func MouseUp(key ...interface{}) error
- func Move(x, y int, displayId ...int)
- func MoveArgs(x, y int) (int, int)
- func MoveClick(x, y int, args ...interface{})
- func MoveMouse(x, y int)deprecated
- func MoveMouseSmooth(x, y int, args ...interface{}) booldeprecated
- func MoveRelative(x, y int)
- func MoveScale(x, y int, displayId ...int) (int, int)
- func MoveSmooth(x, y int, args ...interface{}) bool
- func MoveSmoothRelative(x, y int, args ...interface{})
- func MovesClick(x, y int, args ...interface{})
- func Mul(x int) intdeprecated
- func MultiClick(button string, count int, click ...bool) error
- func OpenImg(path string) ([]byte, error)
- func PadHex(hex CHex) string
- func PadHexs(hex CHex) string
- func Paste(str string) error
- func PasteStr(str string) errordeprecated
- func PidExists(pid int) (bool, error)
- func Pids() ([]int, error)
- func Read(path string) (image.Image, error)
- func ReadAll() (string, error)
- func RgbToHex(r, g, b uint8) uint32
- func Run(path string) ([]byte, error)
- func Save(img image.Image, path string, quality ...int) error
- func SaveCapture(path string, args ...int) error
- func SaveImg(b []byte, path string) error
- func SaveJpeg(img image.Image, path string, quality ...int) error
- func SavePng(img image.Image, path string) error
- func Scale0() intdeprecated
- func Scale1() intdeprecated
- func ScaleF(displayId ...int) float64
- func ScaleX() intdeprecated
- func Scaled(x int, displayId ...int) int
- func Scaled0(x int, f float64) int
- func Scaled1(x int, f float64) int
- func Scroll(x, y int, args ...int)
- func ScrollDir(x int, direction ...interface{})
- func ScrollRelative(x, y int, args ...int)
- func ScrollSmooth(to int, args ...int)
- func SetActive(win Handle)
- func SetActiveC(win MData)
- func SetDelay(d ...int)
- func SetHandle(hwnd int)
- func SetHandlePid(pid int, args ...int)
- func SetXDisplayName(name string) error
- func Sleep(tm int)
- func StrToImg(data string) (image.Image, error)
- func SysScale(displayId ...int) float64
- func ToByteImg(img image.Image, fm ...string) []byte
- func ToImage(bit CBitmap) image.Image
- func ToInterfaces(fields []string) []interface{}
- func ToMMRGBHex(hex CHex) uint32
- func ToRGBA(bit CBitmap) *image.RGBA
- func ToRGBAGo(bmp1 Bitmap) *image.RGBA
- func ToStringImg(img image.Image, fm ...string) string
- func ToStrings(fields []interface{}) []string
- func ToUC(text string) []string
- func ToUint8p(dst []uint8) *uint8
- func Toggle(key ...interface{}) error
- func Try(fun func(), handler func(interface{}))
- func Type(str string, args ...int)
- func TypeDelay(str string, delay int)
- func TypeStr(str string, args ...int)deprecated
- func TypeStrDelay(str string, delay int)deprecated
- func TypeStringDelayed(str string, delay int)deprecated
- func UnicodeType(str uint32, args ...int)
- func Width(img image.Image) int
- func WriteAll(text string) error
- type Bitmap
- type CBitmap
- type CHex
- type Handle
- type MData
- type MMBitmap
- type Map
- type Nps
- type Point
- type Rect
- type Size
Constants ¶
const ( // KeyA define key "a" KeyA = "a" KeyB = "b" KeyC = "c" KeyD = "d" KeyE = "e" KeyF = "f" KeyG = "g" KeyH = "h" KeyI = "i" KeyJ = "j" KeyK = "k" KeyL = "l" KeyM = "m" KeyN = "n" KeyO = "o" KeyP = "p" KeyQ = "q" KeyR = "r" KeyS = "s" KeyT = "t" KeyU = "u" KeyV = "v" KeyW = "w" KeyX = "x" KeyY = "y" KeyZ = "z" // CapA = "A" CapB = "B" CapC = "C" CapD = "D" CapE = "E" CapF = "F" CapG = "G" CapH = "H" CapI = "I" CapJ = "J" CapK = "K" CapL = "L" CapM = "M" CapN = "N" CapO = "O" CapP = "P" CapQ = "Q" CapR = "R" CapS = "S" CapT = "T" CapU = "U" CapV = "V" CapW = "W" CapX = "X" CapY = "Y" CapZ = "Z" // Key0 = "0" Key1 = "1" Key2 = "2" Key3 = "3" Key4 = "4" Key5 = "5" Key6 = "6" Key7 = "7" Key8 = "8" Key9 = "9" KeyGrave = "`" KeyQuoter = '"' KeyQuote = "'" // Backspace backspace key string Backspace = "backspace" Delete = "delete" Enter = "enter" Tab = "tab" Esc = "esc" Escape = "escape" Up = "up" // Up arrow key Down = "down" // Down arrow key Right = "right" // Right arrow key Left = "left" // Left arrow key Home = "home" End = "end" Pageup = "pageup" Pagedown = "pagedown" F1 = "f1" F2 = "f2" F3 = "f3" F4 = "f4" F5 = "f5" F6 = "f6" F7 = "f7" F8 = "f8" F9 = "f9" F10 = "f10" F11 = "f11" F12 = "f12" F13 = "f13" F14 = "f14" F15 = "f15" F16 = "f16" F17 = "f17" F18 = "f18" F19 = "f19" F20 = "f20" F21 = "f21" F22 = "f22" F23 = "f23" F24 = "f24" Cmd = "cmd" // is the "win" key for windows Lcmd = "lcmd" // left command Rcmd = "rcmd" // right command Alt = "alt" Lalt = "lalt" Ralt = "ralt" Ctrl = "ctrl" Lctrl = "lctrl" Rctrl = "rctrl" Control = "control" Shift = "shift" Lshift = "lshift" Rshift = "rshift" Capslock = "capslock" Space = "space" Print = "print" Printscreen = "printscreen" Insert = "insert" Menu = "menu" AudioMute = "audio_mute" AudioVolDown = "audio_vol_down" AudioVolUp = "audio_vol_up" AudioPlay = "audio_play" AudioStop = "audio_stop" AudioPause = "audio_pause" AudioPrev = "audio_prev" AudioNext = "audio_next" AudioRewind = "audio_rewind" AudioForward = "audio_forward" AudioRepeat = "audio_repeat" AudioRandom = "audio_random" Num0 = "num0" Num1 = "num1" Num2 = "num2" Num3 = "num3" Num4 = "num4" Num5 = "num5" Num6 = "num6" Num7 = "num7" Num8 = "num8" Num9 = "num9" NumLock = "num_lock" NumDecimal = "num." NumPlus = "num+" NumMinus = "num-" NumMul = "num*" NumDiv = "num/" NumClear = "num_clear" NumEnter = "num_enter" NumEqual = "num_equal" LightsMonUp = "lights_mon_up" LightsMonDown = "lights_mon_down" LightsKbdToggle = "lights_kbd_toggle" LightsKbdUp = "lights_kbd_up" LightsKbdDown = "lights_kbd_down" )
Defining a bunch of constants.
const ( // Mleft mouse left button Mleft = "left" Mright = "right" Center = "center" WheelDown = "wheelDown" WheelUp = "wheelUp" WheelLeft = "wheelLeft" WheelRight = "wheelRight" )
const ( LEFT_BUTTON uint16 = 0 RIGHT_BUTTON uint16 = 1 CENTER_BUTTON uint16 = 2 WHEEL_DOWN uint16 = 3 WHEEL_UP uint16 = 4 WHEEL_LEFT uint16 = 5 WHEEL_RIGHT uint16 = 6 )
Mouse button constants (replacing C.MMMouseButton)
const ( MOD_NONE uint64 = 0 MOD_ALT uint64 = 0x08 // Mod1Mask MOD_CONTROL uint64 = 0x04 // ControlMask MOD_SHIFT uint64 = 0x01 // ShiftMask MOD_META uint64 = 0x40 // Mod4Mask )
Key modifier flags (replacing C.MMKeyFlags / C.MOD_*)
const ( K_NOT_A_KEY uint32 = 0xFF K_BACKSPACE uint32 = 0x16 // XK_BackSpace K_DELETE uint32 = 0xFFFF // XK_Delete K_RETURN uint32 = 0xFF0D // XK_Return K_TAB uint32 = 0xFF09 // XK_Tab K_ESCAPE uint32 = 0xFF1B // XK_Escape K_UP uint32 = 0xFF52 // XK_Up K_DOWN uint32 = 0xFF54 // XK_Down K_RIGHT uint32 = 0xFF53 // XK_Right K_LEFT uint32 = 0xFF51 // XK_Left K_HOME uint32 = 0xFF50 // XK_Home K_END uint32 = 0xFF57 // XK_End K_PAGEUP uint32 = 0xFF55 // XK_Page_Up K_PAGEDOWN uint32 = 0xFF56 // XK_Page_Down K_F1 uint32 = 0xFFBE K_F2 uint32 = 0xFFBF K_F3 uint32 = 0xFFC0 K_F4 uint32 = 0xFFC1 K_F5 uint32 = 0xFFC2 K_F6 uint32 = 0xFFC3 K_F7 uint32 = 0xFFC4 K_F8 uint32 = 0xFFC5 K_F9 uint32 = 0xFFC6 K_F10 uint32 = 0xFFC7 K_F11 uint32 = 0xFFC8 K_F12 uint32 = 0xFFC9 K_F13 uint32 = 0xFFCA K_F14 uint32 = 0xFFCB K_F15 uint32 = 0xFFCC K_F16 uint32 = 0xFFCD K_F17 uint32 = 0xFFCE K_F18 uint32 = 0xFFCF K_F19 uint32 = 0xFFD0 K_F20 uint32 = 0xFFD1 K_F21 uint32 = 0xFFD2 K_F22 uint32 = 0xFFD3 K_F23 uint32 = 0xFFD4 K_F24 uint32 = 0xFFD5 K_META uint32 = 0xFFEB // XK_Super_L K_LMETA uint32 = 0xFFEB K_RMETA uint32 = 0xFFEC K_ALT uint32 = 0xFFE9 // XK_Alt_L K_LALT uint32 = 0xFFE9 K_RALT uint32 = 0xFFEA K_CONTROL uint32 = 0xFFE3 // XK_Control_L K_LCONTROL uint32 = 0xFFE3 K_RCONTROL uint32 = 0xFFE4 K_SHIFT uint32 = 0xFFE1 // XK_Shift_L K_LSHIFT uint32 = 0xFFE1 K_RSHIFT uint32 = 0xFFE2 K_CAPSLOCK uint32 = 0xFFE5 K_SPACE uint32 = 0x0020 K_PRINTSCREEN uint32 = 0xFF61 // XK_Print K_INSERT uint32 = 0xFF63 // XK_Insert K_MENU uint32 = 0xFF67 // XK_Menu K_AUDIO_VOLUME_MUTE uint32 = 0x1008FF12 K_AUDIO_VOLUME_DOWN uint32 = 0x1008FF11 K_AUDIO_VOLUME_UP uint32 = 0x1008FF13 K_AUDIO_PLAY uint32 = 0x1008FF14 K_AUDIO_STOP uint32 = 0x1008FF15 K_AUDIO_PAUSE uint32 = 0x1008FF31 K_AUDIO_PREV uint32 = 0x1008FF16 K_AUDIO_NEXT uint32 = 0x1008FF17 K_AUDIO_REWIND uint32 = 0x1008FF3E K_AUDIO_FORWARD uint32 = 0x1008FF3F K_AUDIO_REPEAT uint32 = 0x1008FF3B K_AUDIO_RANDOM uint32 = 0x1008FF3C K_NUMPAD_0 uint32 = 0xFFB0 K_NUMPAD_1 uint32 = 0xFFB1 K_NUMPAD_2 uint32 = 0xFFB2 K_NUMPAD_3 uint32 = 0xFFB3 K_NUMPAD_4 uint32 = 0xFFB4 K_NUMPAD_5 uint32 = 0xFFB5 K_NUMPAD_6 uint32 = 0xFFB6 K_NUMPAD_7 uint32 = 0xFFB7 K_NUMPAD_8 uint32 = 0xFFB8 K_NUMPAD_9 uint32 = 0xFFB9 K_NUMPAD_LOCK uint32 = 0xFF7F K_NUMPAD_DECIMAL uint32 = 0xFFAE K_NUMPAD_PLUS uint32 = 0xFFAB K_NUMPAD_MINUS uint32 = 0xFFAD K_NUMPAD_MUL uint32 = 0xFFAA K_NUMPAD_DIV uint32 = 0xFFAF K_NUMPAD_CLEAR uint32 = 0xFFBD K_NUMPAD_ENTER uint32 = 0xFF8D K_NUMPAD_EQUAL uint32 = 0xFFBD K_LIGHTS_MON_UP uint32 = 0x1008FF02 K_LIGHTS_MON_DOWN uint32 = 0x1008FF03 K_LIGHTS_KBD_TOGGLE uint32 = 0x1008FF04 K_LIGHTS_KBD_UP uint32 = 0x1008FF05 K_LIGHTS_KBD_DOWN uint32 = 0x1008FF06 )
Virtual key codes (replacing C.MMKeyCode / C.K_*) Linux X11 keycodes - using uint32 for X11 KeySym values (XF86 multimedia keys exceed uint16 range)
const (
// Version get the robotgo version
Version = "v1.00.0.1189, MT. Baker!"
)
Variables ¶
var ( // MouseSleep set the mouse default millisecond sleep time MouseSleep = 0 // KeySleep set the key default millisecond sleep time KeySleep = 10 // DisplayID set the screen display id DisplayID = -1 // NotPid used the hwnd not pid in windows NotPid bool // Scale option the os screen scale Scale bool )
var Keycode = keycode.Keycode
Keycode robotgo hook key's code map
var MouseMap = keycode.MouseMap
MouseMap robotgo hook mouse's code map
var Special = keycode.Special
Special is the special key map
Functions ¶
func CaptureImg ¶
CaptureImg capture the screen and return image.Image, error
func Click ¶
func Click(args ...interface{}) error
Click click the mouse button and return error
robotgo.Click(button string, double bool)
Examples:
err := robotgo.Click() // default is left button
err := robotgo.Click("right")
func ClickV1 ¶
func ClickV1(args ...interface{})
ClickV1 click the mouse button
robotgo.Click(button string, double bool)
Examples:
robotgo.Click() // default is left button
robotgo.Click("right")
robotgo.Click("wheelLeft")
func CmdCtrl ¶
func CmdCtrl() string
CmdCtrl If the operating system is macOS, return the key string "cmd", otherwise return the key string "ctrl
func DragSmooth ¶
func DragSmooth(x, y int, args ...interface{})
DragSmooth drag the mouse like smooth to (x, y)
Examples:
robotgo.DragSmooth(10, 10)
func FindIds ¶
FindIds finds the all processes named with a subset of "name" (case insensitive), return matched IDs.
func FreeBitmapArr ¶
func FreeBitmapArr(bit ...CBitmap)
FreeBitmapArr free and dealloc the bitmap array
func GetBHandle
deprecated
func GetDisplayBounds ¶
GetDisplayBounds gets the display screen bounds
func GetLocationColor ¶
GetLocationColor get the location pos's color
func GetMousePos
deprecated
func GetPixelColor ¶
GetPixelColor get the pixel color return string
func GetScaleSize ¶
GetScaleSize get the screen scale size
func GetTitle ¶
GetTitle get the window title return string
Examples:
fmt.Println(robotgo.GetTitle()) ids, _ := robotgo.FindIds() robotgo.GetTitle(ids[0])
func GetXidByPid ¶
GetXidByPid get the xid from pid
func KeyTap ¶
KeyTap taps the keyboard code;
See keys supported:
https://github.com/go-vgo/robotgo/blob/master/docs/keys.md#keys
Examples:
robotgo.KeySleep = 100 // 100 millisecond
robotgo.KeyTap("a")
robotgo.KeyTap("i", "alt", "command")
arr := []string{"alt", "command"}
robotgo.KeyTap("i", arr)
robotgo.KeyTap("k", pid int)
func KeyToggle ¶
KeyToggle toggles the keyboard, if there not have args default is "down"
See keys:
https://github.com/go-vgo/robotgo/blob/master/docs/keys.md#keys
Examples:
robotgo.KeyToggle("a")
robotgo.KeyToggle("a", "up")
robotgo.KeyToggle("a", "up", "alt", "cmd")
robotgo.KeyToggle("k", pid int)
func MicroSleep
deprecated
func MouseButtonString ¶
MouseButtonString converts a mouse button to a readable name.
func MouseClick
deprecated
func MouseClick(args ...interface{})
Deprecated: use the Click(),
MouseClick click the mouse ¶
robotgo.MouseClick(button string, double bool)
func Move ¶
Move move the mouse to (x, y)
Examples:
robotgo.MouseSleep = 100 // 100 millisecond robotgo.Move(10, 10)
func MoveClick ¶
func MoveClick(x, y int, args ...interface{})
MoveClick move and click the mouse
robotgo.MoveClick(x, y int, button string, double bool)
Examples:
robotgo.MouseSleep = 100 robotgo.MoveClick(10, 10)
func MoveMouseSmooth
deprecated
func MoveSmooth ¶
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)
Examples:
robotgo.MoveSmooth(10, 10) robotgo.MoveSmooth(10, 10, 1.0, 2.0)
func MoveSmoothRelative ¶
func MoveSmoothRelative(x, y int, args ...interface{})
MoveSmoothRelative move mouse smooth with relative
func MovesClick ¶
func MovesClick(x, y int, args ...interface{})
MovesClick move smooth and click the mouse
use the `robotgo.MouseSleep = 100`
func MultiClick ¶
MultiClick performs multiple clicks and returns error
robotgo.MultiClick(button string, count int)
func Paste ¶
Paste paste a string (supported UTF-8), write the string to clipboard and tap `cmd + v`
func SaveCapture ¶
SaveCapture capture screen and save the screenshot to image
func Scroll ¶
Scroll scroll the mouse to (x, y)
robotgo.Scroll(x, y, msDelay int)
Examples:
robotgo.Scroll(10, 10)
func ScrollDir ¶
func ScrollDir(x int, direction ...interface{})
ScrollDir scroll the mouse with direction to (x, "up") supported: "up", "down", "left", "right"
Examples:
robotgo.ScrollDir(10, "down") robotgo.ScrollDir(10, "up")
func ScrollRelative ¶
ScrollRelative scroll mouse with relative
Examples:
robotgo.ScrollRelative(10, 10)
func ScrollSmooth ¶
ScrollSmooth scroll the mouse smooth, default scroll 5 times and sleep 100 millisecond
robotgo.ScrollSmooth(toy, num, sleep, tox)
Examples:
robotgo.ScrollSmooth(-10) robotgo.ScrollSmooth(-10, 6, 200, -10)
func SetDelay ¶
func SetDelay(d ...int)
SetDelay sets the key and mouse delay robotgo.SetDelay(100) option the robotgo.KeySleep and robotgo.MouseSleep = d
func SetHandlePid ¶
SetHandlePid set the window handle by pid
func SetXDisplayName ¶
SetXDisplayName set XDisplay name (Linux)
func ToInterfaces ¶
func ToInterfaces(fields []string) []interface{}
ToInterfaces convert []string to []interface{}
func ToStringImg ¶
ToStringImg convert image.Image to string
func ToStrings ¶
func ToStrings(fields []interface{}) []string
ToStrings convert []interface{} to []string
func Toggle ¶
func Toggle(key ...interface{}) error
Toggle toggle the mouse, support button:
"left", "center", "right", "wheelDown", "wheelUp", "wheelLeft", "wheelRight"
Examples:
robotgo.Toggle("left") // default is down
robotgo.Toggle("left", "up")
func Type ¶
Type type a string (supported UTF-8)
robotgo.Type(string: "The string to send", int: pid, "milli_sleep time", "x11 option")
Examples:
robotgo.Type("abc@123, Hi galaxy, こんにちは")
robotgo.Type("To be or not to be, this is questions.", pid int)
func TypeDelay ¶
TypeDelay type string with delayed And you can use robotgo.KeySleep = 100 to delayed not this function
func TypeStrDelay
deprecated
func TypeStringDelayed
deprecated
Types ¶
type Bitmap ¶
type Bitmap struct {
ImgBuf *uint8
Width, Height int
Bytewidth int
BitsPixel uint8
BytesPerPixel uint8
}
Bitmap define the go Bitmap struct
The common type conversion of bitmap:
https://github.com/go-vgo/robotgo/blob/master/docs/keys.md#type-conversion
func ImgToBitmap ¶
ImgToBitmap convert the standard image.Image to Bitmap
func RGBAToBitmap ¶
RGBAToBitmap convert the standard image.RGBA to Bitmap
type CBitmap ¶
type CBitmap *MMBitmap
CBitmap define CBitmap as MMBitmap pointer type
func CaptureScreen ¶
CaptureScreen capture the screen return bitmap, use `defer robotgo.FreeBitmap(bitmap)` to free the bitmap
robotgo.CaptureScreen(x, y, w, h int)
func ImgToCBitmap ¶
ImgToCBitmap trans image.Image to CBitmap
type CHex ¶
type CHex uint32
CHex define CHex as rgb Hex type (uint32)
func GetPxColor ¶
GetPxColor get the pixel color return CHex
type Handle ¶
type Handle MData
Handle define window Handle as MData type
func GetHandByPid ¶
GetHandByPid get handle mdata by pid
func GetHandPid
deprecated
type MData ¶
type MData struct {
XWin uintptr
}
MData represents window identification data (platform-specific)
func GetHandByPidC ¶
GetHandByPidC get handle mdata by pid (returns MData)
type MMBitmap ¶
type MMBitmap struct {
ImageBuffer *uint8
Width int32
Height int32
Bytewidth int32
BitsPerPixel uint8
BytesPerPixel uint8
// contains filtered or unexported fields
}
MMBitmap represents a bitmap in memory (replacing C.MMBitmapRef)
func ToMMBitmapRef ¶
ToMMBitmapRef trans CBitmap to *MMBitmap (identity)
type Rect ¶
Rect is rect structure
func GetScreenRect ¶
GetScreenRect get the screen rect (x, y, w, h)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
https://github.com/golang/go/issues/26366
|
https://github.com/golang/go/issues/26366 |
|
Package clipboard read/write on clipboard
|
Package clipboard read/write on clipboard |
|
cmd/gocopy
command
|
|
|
cmd/gopaste
command
|
|
|
example
command
|
|
|
key
command
|
|
|
mouse
command
|
|
|
scale
command
|
|
|
screen
command
|
|
|
window
command
|
|
|
internal
|
|
|
darwin
Package darwin provides macOS API bindings using purego, eliminating the need for cgo.
|
Package darwin provides macOS API bindings using purego, eliminating the need for cgo. |
|
win32
Package win32 provides Windows API bindings using purego/syscall, eliminating the need for cgo.
|
Package win32 provides Windows API bindings using purego/syscall, eliminating the need for cgo. |