fix(lua): [page down long] translation to [page up] (#2668)

Suppress `EVT_KEY_BREAK(KEY_PGDN)` after `EVT_KEY_LONG(KEY_PGDN)` on targets which don't have a physical `KEY_PGUP`.

This way, the sequence is now clean: no more `EVT_VIRTUAL_NEXT_PAGE` emitted after `EVT_VIRTUAL_PREV_PAGE` on these targets.
This commit is contained in:
Raphael Coeffic
2022-11-03 21:16:59 +10:00
committed by GitHub
parent f5f1bd4c18
commit 5958930136
+8 -1
View File
@@ -169,7 +169,14 @@ void LuaEventHandler::onCancel()
void LuaEventHandler::onEvent(event_t event)
{
if (event == EVT_KEY_LONG(KEY_EXIT)) killEvents(KEY_EXIT);
if (event == EVT_KEY_LONG(KEY_EXIT)) {
killEvents(KEY_EXIT);
}
#if !defined(KEYS_GPIO_REG_PGUP)
else if (event == EVT_KEY_LONG(KEY_PGDN)) {
killEvents(KEY_PGDN);
}
#endif
luaPushEvent(event);
}