[Kobo] Enable wake on page turn buttons (#13669)

Adds menu items (toggles) and functionality to turn a kobo back on with the page turn buttons.

Fix #13668
This commit is contained in:
Michael Cummings
2025-08-03 12:43:17 -07:00
committed by GitHub
parent a44e8e958e
commit c4f9c60742
4 changed files with 23 additions and 0 deletions

View File

@@ -822,6 +822,15 @@ function Input:handlePowerManagementOnlyEv(ev)
return keycode
end
-- Treat page turn button like the latest kobo firmware when suspended
if G_reader_settings:isTrue("pageturn_power") then
if keycode == "RPgBack" or keycode == "LPgBack"
or keycode == "RPgFwd" or keycode == "LPgFwd" then
-- When suspended we pretend that the page turn button is a power button
return "PowerRelease"
end
end
if self.fake_event_set[keycode] then
if self.fake_event_args[keycode] then
table.insert(self.fake_event_args[keycode], ev.value)

View File

@@ -237,6 +237,18 @@ if Device:isKobo() then
UIManager:askForRestart()
end
}
if Device:hasKeys() and Device:isMTK() then
common_settings.pageturn_power = {
text = _("Wake up on page-turn button press"),
checked_func = function()
return G_reader_settings:isTrue("pageturn_power")
end,
callback = function()
G_reader_settings:flipNilOrFalse("pageturn_power")
end
}
end
end
if PowerD:hasHallSensor() then

View File

@@ -56,6 +56,7 @@ local order = {
"autostandby",
"autosuspend",
"autoshutdown",
"pageturn_power", -- if Device:isKobo() and Device:hasKeys()
"ignore_sleepcover",
"ignore_open_sleepcover",
"cover_events",

View File

@@ -104,6 +104,7 @@ local order = {
"autostandby",
"autosuspend",
"autoshutdown",
"pageturn_power", -- if Device:isKobo() and Device:hasKeys()
"ignore_sleepcover",
"ignore_open_sleepcover",
"cover_events",