Skip to main content

Module clipboard

Module clipboard 

Source
Expand description

The applier behind the clipboard_write and clipboard_read builtins, running on whichever clipboard backend the app was assembled with. The applier behind the clipboard_write and clipboard_read builtins.

The backend is whatever [ClipboardHost] the assembly put in the world: the OS clipboard on the desktop, the page’s navigator.clipboard in a browser. This applier is the same on both, and an app with no host in the world still answers every read, with empty text, so a script waiting on on_clipboard(tag, text) is never left hanging.

Structs§

PendingClipboardReads
Reads that have an answer and have not been delivered yet.

Functions§

apply_clipboard_commands
Carry out the clipboard commands a script queued, and deliver the reads that have an answer as clipboard_read_events.
clipboard_read_event
The event one answered clipboard_read(tag) reaches the script as: on_clipboard(tag, text), with a per-tag on("clipboard", tag, fn) winning. A clipboard holding no text answers with empty text, so a script waiting on the read can still clear its pending state.