Closed ravener closed 2 years ago
There are "volumeup" and "volumedown" scancodes you could try https://love2d.org/wiki/Scancode#Media_scancodes (via love.keypressed
or love.keyboard.isScancodeDown
). I'm not sure whether SDL's android backend has those hooked up or not.
Yeah they don't work as is, I'm sure there must be some Android related thing to be done first because the system handles it to control the sound.
SDL intentionally doesn't support this feature. https://github.com/libsdl-org/SDL/blob/8c9beb0c873f6ca5efbd88f1ad2648bfc793b2ac/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java#L645-L662
It may be worth asking to support this use case in SDL though, probably as runtime hints that can be set.
Is there a way to handle volume buttons?
I previously used libGDX which allowed something like:
Then I can handle volume button presses like any other key.
It wasn't mentioned in the keyboard wiki so I'm wondering if it's already possible or if not, consider it a suggestion.