fix(lua): Do not push long enter key press on touch (#2782)

Relates to #2736
This commit is contained in:
Raphael Coeffic
2022-11-23 20:32:33 +10:00
committed by GitHub
parent 328fba76b4
commit 8d83487ceb
+6 -3
View File
@@ -55,9 +55,12 @@ void LuaEventHandler::event_cb(lv_event_t* e)
} }
} }
else if (code == LV_EVENT_LONG_PRESSED) { else if (code == LV_EVENT_LONG_PRESSED) {
// Do not use `lv_indev_wait_release()` as some LUA scripts lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act());
// rely on EVT_KEY_BREAK(KEY_ENTER) being generated on key release if(indev_type != LV_INDEV_TYPE_POINTER) {
luaPushEvent(EVT_KEY_LONG(KEY_ENTER)); // Do not use `lv_indev_wait_release()` as some LUA scripts
// rely on EVT_KEY_BREAK(KEY_ENTER) being generated on key release
luaPushEvent(EVT_KEY_LONG(KEY_ENTER));
}
} }
#if defined(HARDWARE_TOUCH) #if defined(HARDWARE_TOUCH)
else if (code == LV_EVENT_PRESSED || code == LV_EVENT_PRESSING) { else if (code == LV_EVENT_PRESSED || code == LV_EVENT_PRESSING) {