mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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:
committed by
Frans de Jonge
parent
9849d89f0e
commit
e8aab49ee9
@@ -52,11 +52,6 @@ local T = require("ffi/util").template
|
||||
|
||||
local ReaderUI = InputContainer:new{
|
||||
name = "ReaderUI",
|
||||
|
||||
key_events = {
|
||||
Close = { { "Home" },
|
||||
doc = "close document", event = "Close" },
|
||||
},
|
||||
active_widgets = {},
|
||||
|
||||
-- if we have a parent container, it must be referenced for now
|
||||
@@ -97,14 +92,17 @@ function ReaderUI:init()
|
||||
self.dialog = self
|
||||
end
|
||||
|
||||
if Device:hasKeys() then
|
||||
self.key_events.Back = {
|
||||
{ "Back" }, doc = "close document",
|
||||
event = "Close" }
|
||||
end
|
||||
|
||||
self.doc_settings = DocSettings:open(self.document.file)
|
||||
|
||||
if Device:hasKeys() then
|
||||
self.key_events.Home = { {"Home"}, doc = "open file browser" }
|
||||
if Device:isSDL() then
|
||||
--if in the desktop emulator
|
||||
--add the old Back key to exit koreader
|
||||
self.key_events.Close = { {"Back"}, doc = "Exit koreader" }
|
||||
end
|
||||
end
|
||||
|
||||
-- a view container (so it must be child #1!)
|
||||
-- all paintable widgets need to be a child of reader view
|
||||
self:registerModule("view", ReaderView:new{
|
||||
@@ -622,4 +620,8 @@ function ReaderUI:dealWithLoadDocumentFailure()
|
||||
error("crengine failed recognizing or parsing this file: unsupported or invalid document")
|
||||
end
|
||||
|
||||
function ReaderUI:onHome()
|
||||
return self:showFileManager()
|
||||
end
|
||||
|
||||
return ReaderUI
|
||||
|
||||
Reference in New Issue
Block a user