Android Question Use volum button for something else

joermo

Member
Licensed User
Shalom!

Is it possible to make an app with B4A where the volume button's behaviour is overridden? I would like to listen for short and long press, and then have the app act upon those instructions.
 
Last edited:
Code: Copy
Sub Activity_KeyPress (KeyCode As Int) As Boolean
    Select KeyCode
        Case KeyCodes.KEYCODE_VOLUME_UP
           
Return True
        Case KeyCodes.KEYCODE_VOLUME_DOWN

Return True          
    End Select
End Sub
dont know if volume long press is possible to intercept
 
Upvote 0
Back
Top