editor_string = ""
def key(k):
global editor_string
s = str_for_key(k)
if s == "enter":
s = "\n"
if s == "space":
s = " "
if s == "bksp":
editor_string = editor_string[:-1]
return
editor_string += s
e.on_anykey = key
@schedule
def main():
while 1:
draw_text(editor_string, 10, 10, (255,255,255))
yield(1) # wait(1)
have you tried something like that? it's written in python but you should get the idea. with some string manipulation (which could be a bit cumbersome in lite-c) and str_width() you should be able to do a complete text editor in this or a similar way.