Added key event to fullscreen Lua widget
This commit is contained in:
@@ -342,14 +342,21 @@ void LuaWidget::refresh(BitmapBuffer* dc)
|
|||||||
lua_rawgeti(lsWidgets, LUA_REGISTRYINDEX, factory->refreshFunction);
|
lua_rawgeti(lsWidgets, LUA_REGISTRYINDEX, factory->refreshFunction);
|
||||||
lua_rawgeti(lsWidgets, LUA_REGISTRYINDEX, luaWidgetDataRef);
|
lua_rawgeti(lsWidgets, LUA_REGISTRYINDEX, luaWidgetDataRef);
|
||||||
|
|
||||||
|
// Pass key event to fullscreen Lua widget
|
||||||
|
if (fullscreen) {
|
||||||
|
event_t event = getWindowEvent();
|
||||||
|
lua_pushinteger(lsWidgets, event);
|
||||||
|
} else
|
||||||
|
lua_pushnil(lsWidgets);
|
||||||
|
|
||||||
// Enable drawing into the current LCD buffer
|
// Enable drawing into the current LCD buffer
|
||||||
luaLcdBuffer = dc;
|
luaLcdBuffer = dc;
|
||||||
luaLcdAllowed = true;
|
luaLcdAllowed = true;
|
||||||
if (lua_pcall(lsWidgets, 1, 0, 0) != 0) {
|
|
||||||
|
if (lua_pcall(lsWidgets, 2, 0, 0) != 0) {
|
||||||
setErrorMessage("refresh()");
|
setErrorMessage("refresh()");
|
||||||
}
|
}
|
||||||
// Remove LCD
|
// Remove LCD
|
||||||
luaLcdAllowed = false;
|
|
||||||
luaLcdBuffer = nullptr;
|
luaLcdBuffer = nullptr;
|
||||||
|
|
||||||
// mark as refreshed
|
// mark as refreshed
|
||||||
|
|||||||
Reference in New Issue
Block a user