A few Kobo input tweaks (#4450)

* Fix the Touch input probe on Trilogy devices that depend on the touch_probe_ev_epoch_time quirk (fix #630)
* Expose a "Pageturn button inversion" feature in the Navigation menu (for all devices with keys) (fix #4446)
* Allow ignoring the accelerometer on the Forma (Screen > Ignore accelerometer rotation events; also available from the Gesture Manager) (fix #4451)
* Fix SleepCover handling on the Forma (fix #4457)
* Make isWifiOn a tiny bit more accurate (check the actual WiFi module instead of sdio_wifi_pwr)
* Move all flash related Screen options to the eInk submenu
This commit is contained in:
NiLuJe
2019-01-08 02:59:47 +01:00
committed by GitHub
parent 1491808454
commit d113cb9475
8 changed files with 156 additions and 37 deletions

View File

@@ -8,7 +8,7 @@ local _ = require("gettext")
local default_gesture = {
tap_right_bottom_corner = "nothing",
tap_left_bottom_corner = Device.hasFrontlight() and "toggle_frontlight" or "nothing",
tap_left_bottom_corner = Device:hasFrontlight() and "toggle_frontlight" or "nothing",
short_diagonal_swipe = "full_refresh",
}
@@ -70,7 +70,8 @@ function ReaderGesture:buildMenu(ges, default)
{_("Reading progress"), "reading_progress", ReaderGesture.getReaderProgress ~= nil},
{_("Full screen refresh"), "full_refresh", true},
{_("Night mode"), "night_mode", true},
{_("Toggle frontlight"), "toggle_frontlight", Device.hasFrontlight()},
{_("Toggle frontlight"), "toggle_frontlight", Device:hasFrontlight()},
{_("Toggle accelerometer"), "toggle_gsensor", Device:canToggleGSensor()},
}
local return_menu = {}
-- add default action to the top of the submenu
@@ -190,15 +191,19 @@ function ReaderGesture:gestureAction(action)
UIManager:setDirty("all", "full")
elseif action == "bookmarks" then
self.ui:handleEvent(Event:new("ShowBookmark"))
elseif action =="page_update_up10" then
elseif action == "page_update_up10" then
self:pageUpdate(10)
elseif action =="page_update_down10" then
elseif action == "page_update_down10" then
self:pageUpdate(-10)
elseif action =="folder_up" then
elseif action == "folder_up" then
self.ui.file_chooser:changeToPath(string.format("%s/..", self.ui.file_chooser.path))
elseif action =="toggle_frontlight" then
elseif action == "toggle_frontlight" then
Device:getPowerDevice():toggleFrontlight()
self:onShowFLOnOff()
elseif action == "toggle_gsensor" then
G_reader_settings:flipNilOrFalse("input_ignore_gsensor")
Device:toggleGSensor()
self:onGSensorToggle()
end
return true
end
@@ -233,4 +238,19 @@ function ReaderGesture:onShowFLOnOff()
return true
end
function ReaderGesture:onGSensorToggle()
local Notification = require("ui/widget/notification")
local new_text
if G_reader_settings:isTrue("input_ignore_gsensor") then
new_text = _("Accelerometer rotation events will now be ignored.")
else
new_text = _("Accelerometer rotation events will now be honored.")
end
UIManager:show(Notification:new{
text = new_text,
timeout = 1.0,
})
return true
end
return ReaderGesture