From 7006c7ceca948942914c42193fdd0b90e2dc50d5 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Tue, 23 Apr 2024 19:51:23 +0200 Subject: [PATCH] bugfix(android): Allow `Volume*` keys to be passed to the user --- src/changelog/unreleased.md | 1 + src/platform_impl/android/mod.rs | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/changelog/unreleased.md b/src/changelog/unreleased.md index 9e5617c08e..3eda9c37cf 100644 --- a/src/changelog/unreleased.md +++ b/src/changelog/unreleased.md @@ -255,3 +255,4 @@ changelog entry. - On Windows, fix cursor not confined to center of window when grabbed and hidden. - On macOS, fix sequence of mouse events being out of order when dragging on the trackpad. - On Wayland, fix decoration glitch on close with some compositors. +- On Android, fix a regression introduced in #2748 to allow volume key events to be received again. diff --git a/src/platform_impl/android/mod.rs b/src/platform_impl/android/mod.rs index 08dbb6752d..f10016d9d6 100644 --- a/src/platform_impl/android/mod.rs +++ b/src/platform_impl/android/mod.rs @@ -438,10 +438,10 @@ impl EventLoop { // Flag keys related to volume as unhandled. While winit does not have a way for applications // to configure what keys to flag as handled, this appears to be a good default until winit // can be configured. - Keycode::VolumeUp | Keycode::VolumeDown | Keycode::VolumeMute => { - if self.ignore_volume_keys { - input_status = InputStatus::Unhandled - } + Keycode::VolumeUp | Keycode::VolumeDown | Keycode::VolumeMute + if self.ignore_volume_keys => + { + input_status = InputStatus::Unhandled } keycode => { let state = match key.action() {