iOS Question Activity_KeyPress -> B4i

Filippo

Expert
Licensed User
Hi,

what is the equivalente of Activity_KeyPress/Activity_KeyUp in B4i?
 

Filippo

Expert
Licensed User
In principle I would like to implement something like:
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
    If KeyCode <> 160 Then
        ...
    Else If KeyCode = KeyCodes.KEYCODE_VOLUME_DOWN OR KeyCode = KeyCodes.KEYCODE_VOLUME_UP Then
        ...
    End If
    Return False
End Sub

Sub Activity_KeyUp (KeyCode As Int) As Boolean
    If KeyCode = 160 OR  KeyCode = KeyCodes.KEYCODE_VOLUME_DOWN OR KeyCode = KeyCodes.KEYCODE_VOLUME_UP Then
        ...
    End If
    Return False
End Sub
 

Filippo

Expert
Licensed User
It is not possible to catch the volume keys without relying on private APIs which will cause your app to be rejected from the app store.
:mad:

Thank you Erel :)
 
Top