mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Implement auto-suspend function for Kobo. Add test case for UIManager:_checkTasks, which should not clear _task_queue_dirty bit before looping.
This commit is contained in:
@@ -251,9 +251,18 @@ function Input:handleKeyBoardEv(ev)
|
||||
end
|
||||
end
|
||||
|
||||
if ev.value == EVENT_VALUE_KEY_RELEASE
|
||||
and (keycode == "Light" or keycode == "Power") then
|
||||
return keycode
|
||||
if ev.value == EVENT_VALUE_KEY_RELEASE then
|
||||
if keycode == "Light" then
|
||||
return keycode
|
||||
elseif keycode == "Power" then
|
||||
-- Kobo generates Power keycode only, we need to decide whether it's
|
||||
-- power-on or power-off ourselves.
|
||||
if self.device.screen_saver_mode then
|
||||
return "Resume"
|
||||
else
|
||||
return "Suspend"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- handle modifier keys
|
||||
|
||||
Reference in New Issue
Block a user