Add touch to Standalone Lua scripts
This commit is contained in:
@@ -57,6 +57,9 @@ extern lua_State * lsScripts;
|
||||
|
||||
extern bool luaLcdAllowed;
|
||||
|
||||
#define EVENT_BUFFER_SIZE 2
|
||||
extern event_t events[EVENT_BUFFER_SIZE];
|
||||
|
||||
#if defined(COLORLCD)
|
||||
extern lua_State * lsWidgets;
|
||||
extern uint32_t luaExtraMemoryUsage;
|
||||
@@ -241,6 +244,21 @@ void * tracer_alloc(void * ud, void * ptr, size_t osize, size_t nsize);
|
||||
inline bool isLuaStandaloneRunning() {
|
||||
return scriptInternalData[0].reference == SCRIPT_STANDALONE;
|
||||
}
|
||||
|
||||
#if defined(HARDWARE_TOUCH)
|
||||
struct LuaTouchData {
|
||||
coord_t touchX;
|
||||
coord_t touchY;
|
||||
coord_t startX;
|
||||
coord_t startY;
|
||||
coord_t slideX;
|
||||
coord_t slideY;
|
||||
short tapCount;
|
||||
};
|
||||
|
||||
extern LuaTouchData touches[EVENT_BUFFER_SIZE];
|
||||
#endif
|
||||
|
||||
#else // defined(LUA)
|
||||
|
||||
#define luaInit()
|
||||
|
||||
Reference in New Issue
Block a user