diff --git a/frontend/ui/inputevent.lua b/frontend/ui/inputevent.lua index 4c5712d0a..87a941e7d 100644 --- a/frontend/ui/inputevent.lua +++ b/frontend/ui/inputevent.lua @@ -390,18 +390,9 @@ function Input:waitEvent(timeout_us, timeout_s) keycode = self.rotation_map[self.rotation][keycode] end - if keycode == "IntoSS" then - Device:intoScreenSaver() - return - elseif keycode == "OutOfSS" then - Device:outofScreenSaver() - return - elseif keycode == "Charging" then - Device:usbPlugIn() - return - elseif keycode == "NotCharging" then - Device:usbPlugOut() - return + if keycode == "IntoSS" or keycode == "OutOfSS" + or keycode == "Charging" or keycode == "NotCharging" then + return keycode end -- handle modifier keys diff --git a/frontend/ui/ui.lua b/frontend/ui/ui.lua index f795f79d0..cc258fc96 100644 --- a/frontend/ui/ui.lua +++ b/frontend/ui/ui.lua @@ -205,7 +205,17 @@ function UIManager:run() -- delegate input_event to handler if input_event then DEBUG(input_event) - self:sendEvent(input_event) + if input_event == "IntoSS" then + Device:intoScreenSaver() + elseif input_event == "OutOfSS" then + Device:outofScreenSaver() + elseif input_event == "Charging" then + Device:usbPlugIn() + elseif input_event == "NotCharging" then + Device:usbPlugOut() + else + self:sendEvent(input_event) + end end end end