Kindle4NT improvements (#3745)

* [device][kindle4] add fake event to kindle4

* modify focusmanager to allow for more complex layout

The focusmanager now naviguate the layout by avoiding nil value
instead of relying on table lenght. It should be completely backward
compatible

* add Dpad naviguation to the touchmenu

* fix crash because virtualkeyboard on non touch device

the kindle4NT has no keyboard nor touch, the fix open the virtual
keyboard so koreader dont crash but it's not useable

* Enable device with keys to use the touchmenu

* Don't get stuck in reader progress statistics plugin

* [underlinecontainer] Fix and remove unused function

References #1898.
This commit is contained in:
onde2rock
2018-03-14 22:16:38 +01:00
committed by Frans de Jonge
parent 9849d89f0e
commit e8aab49ee9
12 changed files with 148 additions and 69 deletions

View File

@@ -1,6 +1,7 @@
local Blitbuffer = require("ffi/blitbuffer")
local CenterContainer = require("ui/widget/container/centercontainer")
local CloseButton = require("ui/widget/closebutton")
local Device = require("device")
local Font = require("ui/font")
local FrameContainer = require("ui/widget/container/framecontainer")
local Geom = require("ui/geometry")
@@ -18,7 +19,7 @@ local VerticalGroup = require("ui/widget/verticalgroup")
local VerticalSpan = require("ui/widget/verticalspan")
local util = require("util")
local _ = require("gettext")
local Screen = require("device").screen
local Screen = Device.screen
local LINE_COLOR = Blitbuffer.gray(0.4)
local BG_COLOR = Blitbuffer.gray(0.2)
@@ -46,6 +47,13 @@ function ReaderProgress:init()
UIManager:setDirty(self, function()
return "ui", self.dimen
end)
if Device:hasKeys() then
self.key_events = {
--don't get locked in on non touch devices
AnyKeyPressed = { { Device.input.group.Any },
seqtext = "any key", doc = "close dialog" }
}
end
self[1] = FrameContainer:new{
width = self.width,
height = self.height,