Skip to content

Commit

Permalink
fix(lua): Do not push long enter key press on touch (#2782)
Browse files Browse the repository at this point in the history
Relates to #2736
  • Loading branch information
raphaelcoeffic authored and pfeerick committed Nov 23, 2022
1 parent a57e8e5 commit 338eafe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions radio/src/lua/lua_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ void LuaEventHandler::event_cb(lv_event_t* e)
}
}
else if (code == LV_EVENT_LONG_PRESSED) {
// 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));
lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act());
if(indev_type != LV_INDEV_TYPE_POINTER) {
// 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)
else if (code == LV_EVENT_PRESSED || code == LV_EVENT_PRESSING) {
Expand Down

0 comments on commit 338eafe

Please sign in to comment.