Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
If KeyCode = KeyCodes.KEYCODE_BACK Then
If Msgbox2("You have hit the BACK BUTTON."&Chr(10)&"If you answer YES, data entered will be LOST?"&Chr(10)&"Do you stil wish to EXIT ?","WARNING !!!"&"Hit CANCEL to continue scoring." ,"Yes", "Cancel", Null, Null) = DialogResponse.POSITIVE Then
' Return False
ExitApplication 'App is exiting
Else
Return True
End If
End If
End Sub'