Documentation
¶
Overview ¶
Package darwin provides macOS API bindings using purego, eliminating the need for cgo.
Index ¶
- func AXIsActive() bool
- func CGEventSourceCreate(stateID uint32) uintptr
- func CGMainDisplayID() uint32
- func CaptureScreen(x, y, w, h int32, displayID int32) ([]byte, int, int)
- func CreateNSString(s string) uintptr
- func DragMouse(x, y int32, button uint16) int
- func GetActiveWindowPID() uint32
- func GetActiveWindowTitle() string
- func GetMainDisplaySize() (int32, int32)
- func GetNumDisplays() int
- func GetPixelColor(x, y int32, displayID int32) uint32
- func GetScreenRect(displayID int32) (int32, int32, int32, int32)
- func GetWindowTitleByPID(pid uint32) string
- func InitError() error
- func InputUTF(str string)
- func Is64Bit() bool
- func KeyCodeForChar(char byte) uint32
- func Location() (int32, int32)
- func MinimizeWindow(pid uint32, minimize bool)
- func MoveMouse(x, y int32) int
- func ScrollMouse(x, y int)
- func ShowAlert(title, msg, defaultBtn, cancelBtn string) bool
- func SysScale(displayID int32) float64
- func ToggleKeyCode(keyCode uint32, down bool, flags uint64, pid uintptr) int
- func ToggleMouse(down bool, button uint16) int
- func UnicodeType(char uint32, pid uintptr, isPid int8)
- type CGPoint
- type CGRect
- type CGSize
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AXIsActive ¶
func AXIsActive() bool
AXIsActive checks if accessibility is enabled for this process
func CGEventSourceCreate ¶
CGEventSourceCreate creates a new CGEventSource
func CaptureScreen ¶
CaptureScreen captures a region of the screen and returns pixel data (BGRA format)
func CreateNSString ¶
CreateNSString creates an NSString from a Go string via ObjC runtime
func GetActiveWindowPID ¶
func GetActiveWindowPID() uint32
GetActiveWindowPID gets the PID of the frontmost application
func GetActiveWindowTitle ¶
func GetActiveWindowTitle() string
GetActiveWindowTitle gets the title of the active window
func GetMainDisplaySize ¶
GetMainDisplaySize returns the main display size
func GetPixelColor ¶
GetPixelColor returns the pixel color at (x, y) as RGB hex value
func GetScreenRect ¶
GetScreenRect returns the screen rectangle
func GetWindowTitleByPID ¶
GetWindowTitleByPID gets the window title using Accessibility API
func KeyCodeForChar ¶
KeyCodeForChar returns the key code for a character
func MinimizeWindow ¶
MinimizeWindow minimizes a window using Accessibility API
func ToggleKeyCode ¶
ToggleKeyCode sends a key down/up event
func ToggleMouse ¶
ToggleMouse toggles a mouse button down or up
func UnicodeType ¶
UnicodeType sends a unicode character using keyboard events