luainstance: add simple GetInput() method

use like this in the lua script:
--
RC_home = 174
local n = neutrino()
repeat msg, data = m:GetInput(1000) until msg == RC_home
This commit is contained in:
Stefan Seyfried
2013-03-18 17:38:37 +01:00
committed by M. Liebmann
parent 4d7e07f81f
commit eefd75537e
2 changed files with 59 additions and 19 deletions

View File

@@ -27,12 +27,19 @@ extern "C" {
}
#include <driver/fb_window.h>
/* this is stored as userdata in the lua_State */
struct CLuaData
{
CFBWindow *fbwin;
CRCInput *rcinput;
};
/* inspired by Steve Kemp http://www.steve.org.uk/ */
class CLuaInstance
{
static const char className[];
static const luaL_Reg methods[];
static CFBWindow *CheckWindow(lua_State *L, int narg);
static CLuaData *CheckData(lua_State *L, int narg);
public:
CLuaInstance();
~CLuaInstance();
@@ -46,6 +53,7 @@ private:
static int PaintBox(lua_State *L);
static int PaintIcon(lua_State *L);
static int RenderString(lua_State *L);
static int GetInput(lua_State *L);
static int GCWindow(lua_State *L);
};