mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
ReaderLink: make AddCurrentLocationToStack always show notification when activated via keypress (#11925)
As seen here https://github.com/koreader/koreader/pull/11900#discussion_r1615474301.
This commit is contained in:
@@ -236,11 +236,11 @@ function ReaderLink:registerKeyEvents()
|
||||
if Device:hasScreenKB() or Device:hasSymKey() then
|
||||
self.key_events.GotoSelectedPageLink = { { "Press" }, event = "GotoSelectedPageLink" }
|
||||
if Device:hasKeyboard() then
|
||||
self.key_events.AddCurrentLocationToStack = { { "Shift", "Press" } }
|
||||
self.key_events.AddCurrentLocationToStackNonTouch = { { "Shift", "Press" } }
|
||||
self.key_events.SelectNextPageLink = { { "Shift", "LPgFwd" }, event = "SelectNextPageLink" }
|
||||
self.key_events.SelectPrevPageLink = { { "Shift", "LPgBack" }, event = "SelectPrevPageLink" }
|
||||
else
|
||||
self.key_events.AddCurrentLocationToStack = { { "ScreenKB", "Press" } }
|
||||
self.key_events.AddCurrentLocationToStackNonTouch = { { "ScreenKB", "Press" } }
|
||||
self.key_events.SelectNextPageLink = { { "ScreenKB", "LPgFwd" }, event = "SelectNextPageLink" }
|
||||
self.key_events.SelectPrevPageLink = { { "ScreenKB", "LPgBack" }, event = "SelectPrevPageLink" }
|
||||
end
|
||||
@@ -718,6 +718,13 @@ function ReaderLink:onAddCurrentLocationToStack(show_notification)
|
||||
if show_notification then
|
||||
Notification:notify(_("Current location added to history."))
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function ReaderLink:onAddCurrentLocationToStackNonTouch()
|
||||
self:addCurrentLocationToStack()
|
||||
Notification:notify(_("Current location added to history."), Notification.SOURCE_ALWAYS_SHOW)
|
||||
return true
|
||||
end
|
||||
|
||||
-- Remember current location so we can go back to it
|
||||
|
||||
Reference in New Issue
Block a user