mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix double-pressing reMarkable 2 power button twice to wake up (#7065)
This commit is contained in:
@@ -141,10 +141,22 @@ function Remarkable:setDateTime(year, month, day, hour, min, sec)
|
||||
return os.execute(command) == 0
|
||||
end
|
||||
|
||||
function Remarkable:suspend()
|
||||
function Remarkable1:suspend()
|
||||
os.execute("systemctl suspend")
|
||||
end
|
||||
|
||||
function Remarkable2:suspend()
|
||||
os.execute("systemctl suspend")
|
||||
-- While device is suspended, when the user presses the power button and wakes up the device,
|
||||
-- a "Power" event is NOT sent.
|
||||
-- So we schedule a manual `UIManager:resume` call just far enough in the future that it won't
|
||||
-- trigger before the `systemctl suspend` command finishes suspending the device
|
||||
local UIManager = require("ui/uimanager")
|
||||
UIManager:scheduleIn(0.5, function()
|
||||
UIManager:resume()
|
||||
end)
|
||||
end
|
||||
|
||||
function Remarkable:resume()
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user