mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[UX] Implement hasFewKeys prototype (#6195)
This is a quick exploration into how the new Device:hasFewKeys() method could work to make things more usable on very limited devices. In the reader, the right is repurposed to open the menu. Left in turn closes it. The same principle is applied to ButtonDialog. This means you can select anything in principle, but once you go right you can't go back. References <https://github.com/koreader/koreader/issues/4029>.
This commit is contained in:
@@ -59,10 +59,16 @@ function ReaderMenu:init()
|
||||
if Device:hasKeys() then
|
||||
if Device:isTouchDevice() then
|
||||
self.key_events.TapShowMenu = { { "Menu" }, doc = "show menu", }
|
||||
if Device:hasFewKeys() then
|
||||
self.key_events.TapShowMenu = { { { "Menu", "Right" } }, doc = "show menu", }
|
||||
end
|
||||
else
|
||||
-- map menu key to only top menu because bottom menu is only
|
||||
-- designed for touch devices
|
||||
self.key_events.ShowReaderMenu = { { "Menu" }, doc = "show menu", }
|
||||
if Device:hasFewKeys() then
|
||||
self.key_events.ShowReaderMenu = { { { "Menu", "Right" } }, doc = "show menu", }
|
||||
end
|
||||
end
|
||||
end
|
||||
self.activation_menu = G_reader_settings:readSetting("activate_menu")
|
||||
|
||||
Reference in New Issue
Block a user