[Hotkeys] add single-key shortcuts (#14867)
This commit is contained in:
1 parent
1ad6674eec
commit
1e0e859ba8
17 files changed
+111
-204
No files matched your search
@@ -43,8 +43,6 @@ local ReaderBookmark = InputContainer:extend{
|
||||
}
|
||||
|
||||
function ReaderBookmark:init()
|
||||
self:registerKeyEvents()
|
||||
|
||||
if G_reader_settings:hasNot("bookmarks_items_per_page") then
|
||||
-- The Bookmarks items per page and items' font size can now be
|
||||
-- configured. Previously, the ones set for the file browser
|
||||
@@ -67,17 +65,11 @@ end
|
||||
|
||||
function ReaderBookmark:onGesture() end
|
||||
|
||||
function ReaderBookmark:registerKeyEvents()
|
||||
if Device:hasKeyboard() then
|
||||
self.key_events.ShowBookmark = { { "B" }, { "Shift", "Left" } }
|
||||
self.key_events.ToggleBookmark = { { "Shift", "Right" } }
|
||||
elseif Device:hasScreenKB() then
|
||||
self.key_events.ShowBookmark = { { "ScreenKB", "Left" } }
|
||||
self.key_events.ToggleBookmark = { { "ScreenKB", "Right" } }
|
||||
end
|
||||
end
|
||||
|
||||
ReaderBookmark.onPhysicalKeyboardConnected = ReaderBookmark.registerKeyEvents
|
||||
-- function ReaderBookmark:registerKeyEvents()
|
||||
-- Now handled by hotkeys.koplugin:
|
||||
-- onShowBookmark (B, Shift-Left)
|
||||
-- onToggleBookmark (Shift-Right)
|
||||
-- end
|
||||
|
||||
function ReaderBookmark:addToMainMenu(menu_items)
|
||||
menu_items.bookmarks = {
|
||||
|
||||
Reference in new issue
Block a user