Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

# View.OnUnhandledKeyEventListener

*** ** * ** ***

` public static interface View.OnUnhandledKeyEventListener `   
` `

|---|
| android.view.View.OnUnhandledKeyEventListener |

<br />

*** ** * ** ***

Interface definition for a callback to be invoked when a hardware key event hasn't been handled by the view hierarchy.

## Summary

| ### Public methods ||
|---|---|
| ` abstract boolean` | ` https://developer.android.com/reference/android/view/View.OnUnhandledKeyEventListener#onUnhandledKeyEvent(android.view.View,%20android.view.KeyEvent)(https://developer.android.com/reference/android/view/View v, https://developer.android.com/reference/android/view/KeyEvent event) ` Called when a hardware key is dispatched to a view after being unhandled during normal `https://developer.android.com/reference/android/view/KeyEvent` dispatch. |

## Public methods

### onUnhandledKeyEvent

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract boolean onUnhandledKeyEvent (View v, 
                KeyEvent event)
```

Called when a hardware key is dispatched to a view after being unhandled during normal `https://developer.android.com/reference/android/view/KeyEvent` dispatch.

<br />

| Parameters ||
|---|---|
| `v` | `View`: The view the key has been dispatched to. <br /> |
| `event` | `KeyEvent`: The KeyEvent object containing information about the event. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the listener has consumed the event, `false` otherwise. <br /> |