Android Question [B4X] B4XPages - how to handle Activity_KeyPress

Alexander Stolte

Expert
Licensed User
Longtime User
How i use Activity_KeyPress in B4XPages?

I see in the main activity is the following:
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean
    Return B4XPages.Delegate.Activity_KeyPress(KeyCode)
End Sub
But wich event is firing?
 

stevenindon

Active Member
Licensed User
Hello all,

First time using B4XPage... how can we catch the volume button in B4XPage like we used to be

My Old example :


B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
    Select Case KeyCode
        Case 4 'BACK KEY
            RaiseUserEvent("ExecReturn_Keycode_Key","BACK")
        Case 24 'VOLUME UP
            RaiseUserEvent("ExecReturn_Keycode_Key","VOLUP")
        Case 25 'VOLUME DOWN
            RaiseUserEvent("ExecReturn_Keycode_Key","VOLDOWN")
    End Select
    Return True
End Sub
 
Upvote 0

Shelby

Well-Known Member
Licensed User
You should probably start a new thread (question) since your comments don't relate to the subject at hand.
 
Upvote 0
Top