screen

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 2 Imported by: 0

README

native/screen

English | 简体中文

List monitors, capture full screen PNG.

  • Dependencies: native (error value), native/internal/sys.
  • Used alone: Yes, no window required. Taking screenshots requires screen recording permission. If you don’t want to pop up the screen yourself, you can apply with native/permission.
import "github.com/dyike/keel/native/screen"

displays, err := screen.Displays()
png, err := screen.Capture(displays[0].ID) // Blocks for up to 10 seconds and cannot be called from the main thread

For details, see Native capabilities · screen.

Documentation

Overview

Package screen lists displays and captures screenshots.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capture

func Capture(displayID uint32) ([]byte, error)

Capture returns a PNG of the display at native resolution. It needs the ScreenRecording permission, never prompts, and times out after 10 seconds; call it off the UI goroutine.

Types

type Display

type Display = sys.Display

Display bounds are logical points; the origin is the primary display's top left.

func Displays

func Displays() ([]Display, error)

Jump to

Keyboard shortcuts

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