Skip to content

Commit 84e98e8

Browse files
authored
fix(color): touch release event incorrectly sent to Lua scripts after key presses (#6032)
1 parent 97841e8 commit 84e98e8

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

radio/src/lua/lua_widget.cpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,6 @@ void LuaEventHandler::event_cb(lv_event_t* e)
120120
downTime = RTOS_GET_MS();
121121
}
122122
} else if (code == LV_EVENT_RELEASED) {
123-
LuaEventData* const es = luaGetEventSlot();
124-
if (es) {
125-
es->event = EVT_TOUCH_BREAK;
126-
TRACE("EVT_TOUCH_BREAK");
127-
}
128-
129123
// tap count handling
130124
uint32_t now = RTOS_GET_MS();
131125
if (now - downTime <= LUA_TAP_TIME) {
@@ -138,6 +132,13 @@ void LuaEventHandler::event_cb(lv_event_t* e)
138132
} else {
139133
tapCount = 0;
140134
}
135+
136+
LuaEventData* const es = luaGetEventSlot();
137+
if (es && downTime) {
138+
downTime = 0;
139+
es->event = EVT_TOUCH_BREAK;
140+
TRACE("EVT_TOUCH_BREAK");
141+
}
141142
}
142143
#endif
143144
}

0 commit comments

Comments
 (0)