On Android, change default implementation to ignore volume keys and let operating system handle them (#2748)
This commit is contained in:
parent
ab46aa5b79
commit
4a36741f9c
3 changed files with 92 additions and 57 deletions
|
|
@ -42,6 +42,11 @@ pub trait EventLoopBuilderExtAndroid {
|
|||
///
|
||||
/// This must be called on Android since the `AndroidApp` is not global state.
|
||||
fn with_android_app(&mut self, app: AndroidApp) -> &mut Self;
|
||||
|
||||
/// Calling this will mark the volume keys to be manually handled by the application
|
||||
///
|
||||
/// Default is to let the operating system handle the volume keys
|
||||
fn handle_volume_keys(&mut self) -> &mut Self;
|
||||
}
|
||||
|
||||
impl<T> EventLoopBuilderExtAndroid for EventLoopBuilder<T> {
|
||||
|
|
@ -49,6 +54,11 @@ impl<T> EventLoopBuilderExtAndroid for EventLoopBuilder<T> {
|
|||
self.platform_specific.android_app = Some(app);
|
||||
self
|
||||
}
|
||||
|
||||
fn handle_volume_keys(&mut self) -> &mut Self {
|
||||
self.platform_specific.ignore_volume_keys = false;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
/// Re-export of the `android_activity` API
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue