Fix side button capture in chat camera

This commit is contained in:
Ilya Laktyushin
2024-06-04 05:05:32 +04:00
parent d94a9e9bb7
commit f21d2ccd84
5 changed files with 68 additions and 16 deletions

View File

@@ -16,15 +16,19 @@ private final class LegacyHandlerImpl: VolumeButtonHandlerImpl {
context: SharedAccountContext,
performAction: @escaping (VolumeButtonsListener.Action) -> Void
) {
self.handler = PGCameraVolumeButtonHandler(upButtonPressedBlock: {
performAction(.up)
}, upButtonReleasedBlock: {
performAction(.upRelease)
}, downButtonPressedBlock: {
performAction(.down)
}, downButtonReleasedBlock: {
performAction(.downRelease)
})
self.handler = PGCameraVolumeButtonHandler(
isCameraSpecific: false,
eventView: context.mainWindow?.viewController?.view,
upButtonPressedBlock: {
performAction(.up)
}, upButtonReleasedBlock: {
performAction(.upRelease)
}, downButtonPressedBlock: {
performAction(.down)
}, downButtonReleasedBlock: {
performAction(.downRelease)
}
)
self.handler.enabled = true
}