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