Key press handlers to show upper menu (#13511)
Some checks failed
macos / macOS 13 x86-64 🔨15.2 🎯10.15 (push) Has been cancelled
macos / macOS 14 ARM64 🔨15.4 🎯11.0 (push) Has been cancelled

This commit is contained in:
hius07
2025-04-06 12:47:00 +03:00
committed by GitHub
parent b7b1717ed4
commit afb33e8518
3 changed files with 15 additions and 6 deletions

View File

@@ -81,11 +81,9 @@ function ReaderMenu:registerKeyEvents()
end
else
-- Map Menu key to top menu only, because the bottom menu is only designed for touch devices.
--- @fixme: Is this still the case?
--- (Swapping between top and bottom might not be implemented, though, so it might still be a good idea).
self.key_events.ShowMenu = { { "Menu" } }
self.key_events.KeyPressShowMenu = { { "Menu" } }
if Device:hasFewKeys() then
self.key_events.ShowMenu = { { { "Menu", "Right" } } }
self.key_events.KeyPressShowMenu = { { { "Menu", "Right" } } }
end
end
end
@@ -497,6 +495,10 @@ function ReaderMenu:onPressMenu()
return true
end
function ReaderMenu:onKeyPressShowMenu(_, key_ev)
return self:onShowMenu()
end
function ReaderMenu:onTapCloseMenu()
self:onCloseReaderMenu()
self.ui:handleEvent(Event:new("CloseConfigMenu"))