Files
MicroPythonOS/internal_filesystem/lib/mpos/clipboard.py
T
2025-06-11 17:54:21 +02:00

19 lines
434 B
Python

import lvgl as lv
copied = None
def add(tocopy):
copied = tocopy
def get():
return copied
def paste_text(text): # called when CTRL-V is pressed on the keyboard
print(f"mpos.ui.clipboard.py paste_text adding {text}")
group = lv.group_get_default()
if not group:
return
focused_obj = group.get_focused()
if focused_obj and isinstance(focused_obj, lv.textarea):
focused_obj.add_text(text)