joermo Member Licensed User Jul 28, 2017 #1 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: Jul 28, 2017
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.
R ronell Well-Known Member Licensed User Longtime User Jul 28, 2017 #2 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
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
joermo Member Licensed User Jul 28, 2017 #3 Great! Thanks! Will this also hinder the volume from being changed? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 30, 2017 #4 If I remember correctly it will override the default volume handling (try it). Upvote 0