mirror of
https://github.com/koreader/koreader.git
synced 2025-12-18 12:02:09 +01:00
[Hotkeys] override self.ui.fonts key_events (#13257)
* Removed [now] unnecessary conditions when removing actions for hotkeys in the `HotKeys:genMenu` function. No longer needed as of #13227 * Added code to reset key events for the overlooked `font` UI component in the `HotKeys:overrideConflictingKeyEvents` function.
This commit is contained in:
@@ -203,11 +203,7 @@ function HotKeys:genMenu(hotkey)
|
|||||||
self.updated = true
|
self.updated = true
|
||||||
touchmenu_instance:updateItems()
|
touchmenu_instance:updateItems()
|
||||||
end
|
end
|
||||||
if self.hotkeys[hotkey] and next(self.hotkeys[hotkey]) then
|
|
||||||
Dispatcher.removeActions(self.hotkeys[hotkey], do_remove)
|
Dispatcher.removeActions(self.hotkeys[hotkey], do_remove)
|
||||||
else -- If no actions are selected, just update the defaults
|
|
||||||
do_remove()
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
@@ -225,11 +221,7 @@ function HotKeys:genMenu(hotkey)
|
|||||||
self.updated = true
|
self.updated = true
|
||||||
touchmenu_instance:updateItems()
|
touchmenu_instance:updateItems()
|
||||||
end
|
end
|
||||||
if self.hotkeys[hotkey] and next(self.hotkeys[hotkey]) then
|
|
||||||
Dispatcher.removeActions(self.hotkeys[hotkey], do_remove)
|
Dispatcher.removeActions(self.hotkeys[hotkey], do_remove)
|
||||||
else
|
|
||||||
do_remove()
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
Dispatcher:addSubMenu(self, sub_items, self.hotkeys, hotkey)
|
Dispatcher:addSubMenu(self, sub_items, self.hotkeys, hotkey)
|
||||||
@@ -429,6 +421,9 @@ function HotKeys:overrideConflictingKeyEvents()
|
|||||||
self.ui.bookmark.key_events = {} -- reset it.
|
self.ui.bookmark.key_events = {} -- reset it.
|
||||||
logger.dbg("Hotkey ReaderBookmark:registerKeyEvents() overridden.")
|
logger.dbg("Hotkey ReaderBookmark:registerKeyEvents() overridden.")
|
||||||
|
|
||||||
|
self.ui.font.key_events = {} -- reset it.
|
||||||
|
logger.dbg("Hotkey ReaderFont:registerKeyEvents() overridden.")
|
||||||
|
|
||||||
if Device:hasScreenKB() or Device:hasSymKey() then
|
if Device:hasScreenKB() or Device:hasSymKey() then
|
||||||
local readerconfig = self.ui.config
|
local readerconfig = self.ui.config
|
||||||
readerconfig.key_events = {} -- reset it, then add our own
|
readerconfig.key_events = {} -- reset it, then add our own
|
||||||
|
|||||||
Reference in New Issue
Block a user