Add touch to Standalone Lua scripts

This commit is contained in:
jfrickmann
2021-11-19 08:01:28 -05:00
parent df153b4b1f
commit ce7b408445
5 changed files with 212 additions and 47 deletions
+18
View File
@@ -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()