Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
If GameState = GameState_Playing Then
If KeyCode = KeyCodes.KEYCODE_BACK Then
If lGdx.IsInitialized Then lGdx.Pause
If Msgbox2("Return to main menu?", "", "Yes", "", "No", Null) = DialogResponse.POSITIVE Then
GameState = GameState_Menu
End If
If lGdx.IsInitialized Then lGdx.Resume
Return True
End If
End If
Return False
End Sub