Does anyone know how to read the volume buttons on Android?
As far as I have tested the volume buttons (on my Galaxy S2) do nothing to the general sound volume of a GLBasic app. However, I can't read the buttons either. I've tried key(n) up to 255, reading all possible joystick button presses, scanning the mouse button registers and even inkey$ just in case. Nothing is showing up.
I found something about it here (http://stackoverflow.com/questions/2874743/android-volume-buttons-used-in-my-application).
Not exactly reading the buttons, but it does control the volume control.
Not sure if this will work on the GS2, but it worked on my Xperia Arc ...
In the folder "...\distribute\Android\src\com\glbasic\test" is a file called SDLActivity.java.
Scroll down until you find //Key Events
Then, for the KeyEvent.ACTION_DOWN change the
return true
to
retrun super.onKeyDown(keyCode, event)
This (should) bring up the standard media volume control when the buttons are pressed (at least it does for me)
Hope it works for you too.
You're the best!! Next update will have that change, too.
Thanks Minion. :D
Will try that tonight, when I pry the phone from my GF's fingers.
Works perfectly. Thanks.