clipboard

package
v0.10.9 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadText

func ReadText() (string, error)

ReadText returns the clipboard's text content, or "" if the clipboard holds no text. The text is returned verbatim — no trimming — so a round-trip through WriteText preserves leading/trailing whitespace.

func SetProvider

func SetProvider(p Provider)

func WriteText

func WriteText(text string) error

WriteText replaces the clipboard's content with text. Every byte of text is treated as data, never as syntax for an underlying shell command.

Types

type Provider

type Provider interface {
	ReadText() (string, error)
	WriteText(text string) error
}

Provider is a native clipboard backend. On mobile the shell registers one via SetProvider (ClipboardManager on Android, UIPasteboard on iOS); on desktop the built-in platform implementation is used when no provider is set.

Jump to

Keyboard shortcuts

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