I used some code from forum to capture keycodes and it works for keycode_back and keycode_menu but not working for keycode_home. How can i capture it ?
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
Dim answ As Int
'Log(KeyCode)
Select KeyCode
Case KeyCodes.KEYCODE_HOME
Userset_Click
Case KeyCodes.KEYCODE_BACK
'If AskBeforeLeaving = True Then
answ = Msgbox2("Do you really want to leave the application ?", "ATTENTION", "Yes", "", "No", Null)
'answ = Msgbox2(Texts(1), Texts(2), Texts(3), "", Texts(4), Null)
If answ = DialogResponse.POSITIVE Then
Return False
Else
Return True
End If
'End If
End Select
Return False
End Sub