9.0.0.11
22 Clipboard
This section covers system clipboard access.
22.1 Clipboard Operations
procedure
(clipboard-text) → (or/c string? #f)
Gets text from the system clipboard.
Returns the clipboard text as a string, or #f if the clipboard is empty or doesn’t contain text.
(define text (clipboard-text)) (when text (printf "Clipboard contains: ~a~n" text))
procedure
(set-clipboard-text! text) → #t
text : string?
Sets the system clipboard text.
Returns #t on success.
(set-clipboard-text! "Hello from SDL3!")
procedure
Returns #t if the clipboard contains text.
(when (clipboard-has-text?) (define text (clipboard-text)) (handle-paste text))