mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
InputContainer: Fall cleanup ;).
Get rid of the doc & seqtext fields, as they are not actually used (nor are they particularly useful, the event handler's name should be pretty self-explanatory). Also, tweak the key_events documentation to highlight the quirks of the API, especially as far as array nesting is involved... Random drive-by cleanup of the declarations of key_events & ges_events to re-use the existing instance object (now that we know they're sane ;p) for tables with a single member (less GC pressure).
This commit is contained in:
@@ -58,16 +58,16 @@ function ReaderMenu:init()
|
||||
|
||||
if Device:hasKeys() then
|
||||
if Device:isTouchDevice() then
|
||||
self.key_events.TapShowMenu = { { "Menu" }, doc = "show menu", }
|
||||
self.key_events.TapShowMenu = { { "Menu" } }
|
||||
if Device:hasFewKeys() then
|
||||
self.key_events.TapShowMenu = { { { "Menu", "Right" } }, doc = "show menu", }
|
||||
self.key_events.TapShowMenu = { { { "Menu", "Right" } } }
|
||||
end
|
||||
else
|
||||
-- map menu key to only top menu because bottom menu is only
|
||||
-- designed for touch devices
|
||||
self.key_events.ShowMenu = { { "Menu" }, doc = "show menu", }
|
||||
self.key_events.ShowMenu = { { "Menu" } }
|
||||
if Device:hasFewKeys() then
|
||||
self.key_events.ShowMenu = { { { "Menu", "Right" } }, doc = "show menu", }
|
||||
self.key_events.ShowMenu = { { { "Menu", "Right" } } }
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -83,8 +83,8 @@ function ReaderMenu:getPreviousFile()
|
||||
end
|
||||
|
||||
function ReaderMenu:onReaderReady()
|
||||
-- deligate gesture listener to readerui
|
||||
self.ges_events = {}
|
||||
-- delegate gesture listener to readerui
|
||||
self.ges_events = nil
|
||||
self.onGesture = nil
|
||||
if not Device:isTouchDevice() then return end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user