mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Kindle: toggle cover events
Allow disabling the hall efect sensor via the sysfs knob, so the kindle system wont sleep & wake the device for those of use that stay in koreader, are caseless and have get spurious wakeups
This commit is contained in:
@@ -4,6 +4,7 @@ local Event = require("ui/event")
|
||||
local InfoMessage = require("ui/widget/infomessage")
|
||||
local Language = require("ui/language")
|
||||
local NetworkMgr = require("ui/network/manager")
|
||||
local PowerD = Device:getPowerDevice()
|
||||
local UIManager = require("ui/uimanager")
|
||||
local _ = require("gettext")
|
||||
local N_ = _.ngettext
|
||||
@@ -236,6 +237,17 @@ if Device:isKobo() then
|
||||
}
|
||||
end
|
||||
|
||||
if Device:isKindle() and PowerD:hasHallSensor() then
|
||||
common_settings.cover_events = {
|
||||
text = _("Disable Kindle cover events"),
|
||||
help_text = _([[Toggle the Hall effect sensor.
|
||||
This is used to detect if the cover is closed, which will automatically sleep and wake the device. If there is no cover present the sensor may cause spurious wakeups when located next to a magnetic source.]]),
|
||||
keep_menu_open = true,
|
||||
checked_func = function() return not PowerD:isHallSensorEnabled() end,
|
||||
callback = function() PowerD:onToggleHallSensor() end,
|
||||
}
|
||||
end
|
||||
|
||||
common_settings.night_mode = {
|
||||
text = _("Night mode"),
|
||||
checked_func = function() return G_reader_settings:isTrue("night_mode") end,
|
||||
|
||||
Reference in New Issue
Block a user