Skip to content

Media Key's support  #3

@Yoda-Man

Description

@Yoda-Man

the sample app is not detailed enough can see where you implineted this

override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
TvRemoteEventProcessor.notifyEvent(event = event)
return super.onKeyDown(keyCode, event)
}
override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean {
TvRemoteEventProcessor.notifyEvent(event = event)
return super.onKeyUp(keyCode, event)
}

override fun dispatchKeyEvent(event: KeyEvent): Boolean {

    when(event.keyCode) {
        KeyEvent.KEYCODE_BUTTON_B,
        KeyEvent.KEYCODE_BACK,

        KeyEvent.KEYCODE_BUTTON_SELECT,
        KeyEvent.KEYCODE_BUTTON_A,
        KeyEvent.KEYCODE_ENTER,
        KeyEvent.KEYCODE_DPAD_CENTER,
        KeyEvent.KEYCODE_NUMPAD_ENTER -> {
            // Skip the center pad because you get it on the on onKeyDown
            return super.dispatchKeyEvent(event)
        }
    }
    if(event.action == KeyEvent.ACTION_DOWN) {
        TvRemoteEventProcessor.notifyEvent(event = event)
    }
    return super.dispatchKeyEvent(event)
} 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions