mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Add support for physical button for page crop (#6091)
See: #2003 In page crop: physical press button = OK physical back button = Cancel
This commit is contained in:
@@ -49,6 +49,10 @@ function BBoxWidget:init()
|
||||
}
|
||||
}
|
||||
end
|
||||
if Device:hasKeys() then
|
||||
self.key_events.Close = { {"Back"}, doc = "close windows" }
|
||||
self.key_events.Select = { {"Press"}, doc = "confirm adjust" }
|
||||
end
|
||||
end
|
||||
|
||||
function BBoxWidget:getSize()
|
||||
@@ -222,4 +226,13 @@ function BBoxWidget:onConfirmAdjust(arg, ges)
|
||||
return true
|
||||
end
|
||||
|
||||
function BBoxWidget:onClose()
|
||||
self.ui:handleEvent(Event:new("CancelPageCrop"))
|
||||
end
|
||||
|
||||
function BBoxWidget:onSelect()
|
||||
self.ui:handleEvent(Event:new("ConfirmPageCrop"))
|
||||
end
|
||||
|
||||
|
||||
return BBoxWidget
|
||||
|
||||
Reference in New Issue
Block a user