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:
Robert
2020-04-25 09:03:19 +02:00
committed by GitHub
parent fdc92e950e
commit 72c9ec2aa0
2 changed files with 16 additions and 3 deletions

View File

@@ -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