1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-15 04:15:26 +03:00

Re #2469: part2: keys accesible to Lua telemetry scripts (Taranis only) (ported #3087 from master commits 3186a5d99..94d8b8b0e8d)

This commit is contained in:
Damjan Adamic 2015-11-26 19:32:28 +01:00
parent cbe244fc6c
commit f184e9bed3
3 changed files with 90 additions and 38 deletions

View file

@ -541,8 +541,12 @@ TODO table of events/masks
*/
static int luaKillEvents(lua_State *L)
{
int event = luaL_checkinteger(L, 1);
killEvents(event);
uint8_t key = EVT_KEY_MASK(luaL_checkinteger(L, 1));
// prevent killing PAGE, ENT and EXIT (only in telemetry scripts)
// todo add which tpye of script is running before p_call()
if (key != KEY_EXIT && key != KEY_ENTER && key != KEY_PAGE) {
killEvents(key);
}
return 0;
}