Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
Select KeyCode
Case KeyCodes.KEYCODE_DPAD_LEFT
Log("DPAD_LEFT")
Case KeyCodes.KEYCODE_DPAD_RIGHT
Log("DPAD_RIGHT")
Case KeyCodes.KEYCODE_DPAD_DOWN
Log("DPAD_DOWN")
Case KeyCodes.KEYCODE_DPAD_UP
Log("DPAD_UP")
Case KeyCodes.KEYCODE_ENTER
Log("DPAD_ENTER/CENTER")
Case Else
Log(KeyCode)
End Select
End Sub
OK I'm getting sporadic behavior with logging my key presses on the d-pad (and tab and enter buttons) on my Android keyboard.
Like sometimes it logs D-pad-left, right, etc. but most of the time not.
Having a hard time isolating why.
Here's your code slightly modified:
'FOR FIRE TV
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
Select KeyCode
Case KeyCodes.KEYCODE_DPAD_LEFT
Log("DPAD_LEFT")
'Tab_Prev will go in this spot
Case KeyCodes.KEYCODE_BACK
Log("KEYCODE_BACK") 'remote controller
'Tab_Prev will go in this spot
Case KeyCodes.KEYCODE_MEDIA_REWIND
Log("KEYCODE_MEDIA_REWIND") 'remote controller
'Tab_Prev will go in this spot
Case KeyCodes.KEYCODE_DPAD_RIGHT
Log("DPAD_RIGHT")
Tab_Next 'never gets called :-(
'Do I want to consume the event?
'Return True
Case KeyCodes.KEYCODE_MEDIA_FAST_FORWARD
Log("KEYCODE_MEDIA_FAST_FORWARD") 'remote controller
Tab_Next 'never gets called :-(
'Do I want to consume the event?
'Return True
Case KeyCodes.KEYCODE_DPAD_DOWN
Log("DPAD_DOWN")
Case KeyCodes.KEYCODE_DPAD_UP
Log("DPAD_UP")
Case KeyCodes.KEYCODE_ENTER
Log("DPAD_ENTER/CENTER")
Case Else
Log("activity_keypress=" & KeyCode)
'this firing SOMETIMES
End Select
End Sub
Ideas?