../
kernel
functions
add
all
apply_delta
assert
atan2
btn
btnp
camera
cd
char
chooser
circ
circfill
clip
cls
color
cos
count
cp
create_delta
create_gui
create_process
cursor
date
del
deli
env
error
exit
fetch
fetch_metadata
fget
fillp
foreach
fset
fstat
fullpath
get_clipboard
get_display
get_draw_target
get_spr
include
input
key
keyp
line
ls
map
max
memcpy
memmap
memset
menuitem
mget
mkdir
mouse
mouselock
mset
music
mv
note
on_event
open
oval
ovalfill
peek
peek2
peek4
peek8
peektext
pget
pid
pod
poke
poke2
poke4
poke8
printh
pset
pwd
readtext
rect
rectfill
rm
rrect
rrectfill
scoresub
send_message
set_clipboard
set_draw_target
set_spr
sfx
sin
socket
split
spr
sspr
stat
stop
store
store_metadata
sub
time
tokenoid
type
unmap
unpod
userdata
vec
vid
window
set_clipboard(text)
Overview
set_clipboard sets the user's clipboard to text.
For structured objects to be copied to the clipboard; use pod() and unpod() with a plaintext format (0x0 or 0x7).
This is typically used in conjunction with get_clipboard().
Arguments
text: string
The text to be copied to the clipboard.
Examples
Sourced from the Picotron Manual
ud = userdata("u8", 64, 64)
set_draw_target(ud)
circfill(32,32,31,8)
circfill(32,32,16,18)
set_draw_target()
set_clipboard(pod(ud, 0x7, {pod_type="image"}))
--> can paste into the code editor
out = "[output]\n"
function _update()
if key"ctrl" and keyp"c" then
local test_str = "test"..flr(rnd(10000))
set_clipboard(test_str)
out ..= "ctrl-c copied: "..test_str.."\n"
end
if key"ctrl" and keyp"v" then
out ..= "ctrl-v pasted: "..get_clipboard().."\n"
end
-- this will only work for clipboard contents that is copied from within Picotron
-- (or within the same app when sandboxed), unless pasted with ctrl-v first.
if key"ctrl" and keyp"b" then
out ..= "ctrl-b pasted: "..get_clipboard().."\n"
end
end
function _draw()
cls()
print(out, 2,2,7)
end