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:
@@ -27,24 +27,23 @@ local ReaderLink = InputContainer:extend{
|
||||
|
||||
function ReaderLink:init()
|
||||
if Device:hasKeys() then
|
||||
self.key_events.SelectNextPageLink = {
|
||||
{"Tab" },
|
||||
doc = "select next page link",
|
||||
event = "SelectNextPageLink",
|
||||
self.key_events = {
|
||||
SelectNextPageLink = {
|
||||
{ "Tab" },
|
||||
event = "SelectNextPageLink",
|
||||
},
|
||||
SelectPrevPageLink = {
|
||||
{ "Shift", "Tab" },
|
||||
{ "Sym", "Tab" }, -- Shift or Sym + Tab
|
||||
event = "SelectPrevPageLink",
|
||||
},
|
||||
GotoSelectedPageLink = {
|
||||
{ "Press" },
|
||||
event = "GotoSelectedPageLink",
|
||||
},
|
||||
-- "Back" is handled by ReaderBack, which will call our onGoBackLink()
|
||||
-- when G_reader_settings:readSetting("back_in_reader") == "previous_location"
|
||||
}
|
||||
self.key_events.SelectPrevPageLink = {
|
||||
{"Shift", "Tab" },
|
||||
{"Sym", "Tab" }, -- Right Shift + Tab
|
||||
doc = "select previous page link",
|
||||
event = "SelectPrevPageLink",
|
||||
}
|
||||
self.key_events.GotoSelectedPageLink = {
|
||||
{ "Press" },
|
||||
doc = "go to selected page link",
|
||||
event = "GotoSelectedPageLink",
|
||||
}
|
||||
-- "Back" is handled by ReaderBack, which will call our onGoBackLink()
|
||||
-- when G_reader_settings:readSetting("back_in_reader") == "previous_location"
|
||||
end
|
||||
if Device:isTouchDevice() then
|
||||
self.ui:registerTouchZones({
|
||||
|
||||
Reference in New Issue
Block a user