ScreenSaverWidget: Actually enable the onAnyKeyPressed handler

Which allows us to exit the screensaver on, well, any key press ;o).
pull/9645/head
NiLuJe 2 years ago
parent 854cbe9f94
commit 78381c3afa

@ -19,7 +19,7 @@ local ScreenSaverWidget = InputContainer:extend{
function ScreenSaverWidget:init() function ScreenSaverWidget:init()
if Device:hasKeys() then if Device:hasKeys() then
self.key_events = { self.key_events = {
Close = { {Device.input.group.Back}, doc = "close widget" }, AnyKeyPressed = { { Device.input.group.Any }, seqtext = "any key", doc = "close widget" },
} }
end end
if Device:isTouchDevice() then if Device:isTouchDevice() then
@ -112,11 +112,6 @@ function ScreenSaverWidget:showWaitForGestureMessage(msg)
infomsg:free() infomsg:free()
end end
function ScreenSaverWidget:onExitScreensaver()
self:onClose()
return true
end
function ScreenSaverWidget:update() function ScreenSaverWidget:update()
self.height = Screen:getHeight() self.height = Screen:getHeight()
self.width = Screen:getWidth() self.width = Screen:getWidth()
@ -167,11 +162,8 @@ function ScreenSaverWidget:onClose()
UIManager:close(self) UIManager:close(self)
return true return true
end end
ScreenSaverWidget.onAnyKeyPressed = ScreenSaverWidget.onClose
function ScreenSaverWidget:onAnyKeyPressed() ScreenSaverWidget.onExitScreensaver = ScreenSaverWidget.onClose
self:onClose()
return true
end
function ScreenSaverWidget:onCloseWidget() function ScreenSaverWidget:onCloseWidget()
-- Restore to previous rotation mode, if need be. -- Restore to previous rotation mode, if need be.

Loading…
Cancel
Save