lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Is there some explanation why it fails?

You don't say *how* it fails but here is a guess: Don't you need a
lua_newtable() just before the keyboard and mouse loops?

   // Store key constants in 'keybaord' table
   lua_newtable(L);
   ...
   lua_setglobal(L, 'keyboard');
 
   // Store mouse button constants in 'mouse' table
   lua_newtable(L);
   ...
   lua_setglobal(L, 'mouse');
 
BTW, no need for this:
   lua_settop(L, 0);