You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have done some investigation on the topic of volume buttons and why they are not working on Android. I thought it could be related to how types of input events was handled by winit's Android implementation (source) but no. I also suspected it could be related to being in fullscreen mode but that does not appear to be it either. Then I stumbled upon mention by @msiglreith in issue #2010 mentioning that some buttons are marked as handled. So I figure I post a question here and see if anyone has good ideas on where to start looking?
I have tried using Android Studio and intercepting key events there and I was able to prevent the UI to appear. See comment in code below. However I'm not able to achieve similar things in Rust.
publicbooleandispatchKeyEvent(KeyEventevent){
intkeyCode = event.getKeyCode();
if(event.getAction() == KeyEvent.ACTION_DOWN){
switch (keyCode) {
caseKeyEvent.KEYCODE_VOLUME_UP:
returnfalse; // If changed to true the media volume button does not appearcaseKeyEvent.KEYCODE_VOLUME_DOWN:
returnfalse; // If changed to true the media volume button does not appeardefault:
returnsuper.dispatchKeyEvent(event);
}
}
returnsuper.dispatchKeyEvent(event);
}
Goal is to have the "media volume panel" appear when pressing the volume buttons, so that the application does not have to reimplement that UI and the volume should change according to the pressed buttons.
The text was updated successfully, but these errors were encountered:
Hi, for volume buttons there is PR which would do this already #1919. In general as mentioned it would be probably good to expose some feedback option/filtering for these button events on Android.
Hello!
I have done some investigation on the topic of volume buttons and why they are not working on Android. I thought it could be related to how types of input events was handled by
winit
's Android implementation (source) but no. I also suspected it could be related to being in fullscreen mode but that does not appear to be it either. Then I stumbled upon mention by @msiglreith in issue #2010 mentioning that some buttons are marked as handled. So I figure I post a question here and see if anyone has good ideas on where to start looking?I have tried using Android Studio and intercepting key events there and I was able to prevent the UI to appear. See comment in code below. However I'm not able to achieve similar things in Rust.
Goal is to have the "media volume panel" appear when pressing the volume buttons, so that the application does not have to reimplement that UI and the volume should change according to the pressed buttons.
The text was updated successfully, but these errors were encountered: