Documentation
¶
Overview ¶
Package sys binds the platform code. Public packages validate arguments and call it; it never selects behavior by OS outside build tags.
Index ¶
- Constants
- func Capture(id uint32) ([]byte, error)
- func Click(button int) error
- func ClipboardRead(done func([]byte, error))
- func CollectMIMEClipboard(targets map[string]bool, read func(string) ([]byte, error)) ([]byte, error)
- func HasKey(key string) bool
- func Hotkey(key string, mods uint, fn func()) (func() error, error)
- func Key(key string, down bool) error
- func MouseMove(px, py float64) error
- func MousePosition() (float64, float64, error)
- func NotificationAvailable() bool
- func NotificationPermission(done func(error))
- func NotificationPost(id, title, body string, done func(error))
- func NotificationPostActivated(id, title, body string, onClick func(string), done func(error))
- func NotificationPostInteractive(id, title, body string, onClick func(), done func(error))
- func NotificationRemove(id string, done func(error))
- func Permission(kind int, request bool) (bool, error)
- func ProcessDirectory(pid int) (string, error)
- func ProcessForegroundPID(fd uintptr) (int, error)
- type Display
Constants ¶
View Source
const ( ModCtrl = 1 << iota ModAlt ModShift ModCmd )
Modifier bits understood by the native hotkey code.
View Source
const ClipboardByteLimit = clipboardByteLimit
ClipboardByteLimit bounds one clipboard snapshot.
Variables ¶
This section is empty.
Functions ¶
func Capture ¶
Capture reads the display's pixels from the root window and encodes them as PNG. It handles the 24- and 32-bit true color visuals X servers use.
func ClipboardRead ¶
func CollectMIMEClipboard ¶ added in v0.0.4
func CollectMIMEClipboard(targets map[string]bool, read func(string) ([]byte, error)) ([]byte, error)
CollectMIMEClipboard builds a snapshot from MIME-typed data, as X11 and Wayland offer it; targets lists the offered types.
func Hotkey ¶
Hotkey grabs key+mods; fn runs on its own goroutine and presses that arrive while it runs are merged.
func MousePosition ¶
func NotificationAvailable ¶
func NotificationAvailable() bool
func NotificationPermission ¶
func NotificationPermission(done func(error))
func NotificationPost ¶
func NotificationRemove ¶
func ProcessDirectory ¶ added in v0.1.6
func ProcessForegroundPID ¶ added in v0.1.6
Types ¶
Click to show internal directories.
Click to hide internal directories.