I like lua so much, so I feel happy that I can use it on Kolibri. I want to port some of my old lua stuff, but I am missing one thing: console input. How can I manage (or emulate) this?
Latest version doesn't create console window. Instead you should to create window and buttons, and check keyboard and screen events. If you need details, I'll write it here later:)
Also, if you really need console input and output, I'll try to add these functions to KOS port
Thnak you for your response!
Okay! Now I have other plans, but I think I can add console input and output before Xmas.
You can't draw pictures from Lua in Native GUI yet, but I can add almost any function you want. Just write what you need
Also it'll be nice to add Lua Sockets, but there are no realization of POSIX sockets in Kolibri yet.
Hi, severak! I updated port to 5.2.0 and added new commands:
copen() - create console window
cclose() - close console window
cprintf("string",value,anything,separated_by_commas) - print anything
val=cgets() - get string from keyboard
Link to download: download/file.php?id=3105
--console functions
copen() - open console
cclose() - close console
cprintf() - printf something
cgets() - get string
--window functions
paintstart() --begin window redraw
paintend() --finish window redraw
window(10,10,153,180,65069280) --create window
textout(3,13,0,"LuaCalc") --print text
makebutton(6,60,20,20,17,13619151) --create/delete button (take a look at KolibriOS system functions)
waitevent() --wait for event
checkevent() --check for event (take a look at sysfuncs too)
getkey() --get pressed key from keyboard
getbutton() --get code of pressed screen button
sysexit() --stop execution
systime() - get time (in BCD)
sysdate() --get date (in BCD)
drawpixel(x,y,c) --nuff said :)
drawline(x,y,x1,y1,c)