fix(color): touch release event incorrectly sent to Lua scripts after key presses (#6032)

This commit is contained in:
philmoz
2025-03-31 15:14:07 +10:00
committed by GitHub
parent 97841e86ef
commit 84e98e8b4b
+7 -6
View File
@@ -120,12 +120,6 @@ void LuaEventHandler::event_cb(lv_event_t* e)
downTime = RTOS_GET_MS();
}
} else if (code == LV_EVENT_RELEASED) {
LuaEventData* const es = luaGetEventSlot();
if (es) {
es->event = EVT_TOUCH_BREAK;
TRACE("EVT_TOUCH_BREAK");
}
// tap count handling
uint32_t now = RTOS_GET_MS();
if (now - downTime <= LUA_TAP_TIME) {
@@ -138,6 +132,13 @@ void LuaEventHandler::event_cb(lv_event_t* e)
} else {
tapCount = 0;
}
LuaEventData* const es = luaGetEventSlot();
if (es && downTime) {
downTime = 0;
es->event = EVT_TOUCH_BREAK;
TRACE("EVT_TOUCH_BREAK");
}
}
#endif
}