# TelephoneKeypadCallback

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/dialer/TelephoneKeypadCallback.java+class:androidx.car.app.dialer.TelephoneKeypadCallback) Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

*** ** * ** ***


```
@ExperimentalCarApi
public interface TelephoneKeypadCallback
```

<br />

*** ** * ** ***

Callbacks generated by the `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate`.

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadCallback#onKeyDown(int)(int key)` Called when a key is pushed. |
| `abstract void` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadCallback#onKeyLongPress(int)(int key)` Called when a key is pressed and held. |
| `abstract void` | `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadCallback#onKeyUp(int)(int key)` Called when a key is released. |

## Public methods

### onKeyDown

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

```
abstract void onKeyDown(int key)
```

Called when a key is pushed. This is only called once for each user interaction, even if the key is held down (eg. does not repeat the same event call for a single key push).

This event provides the `key` that was pressed in the form of an int constant defined in the `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate` object prefixed with \`KEY_\`.

### onKeyLongPress

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

```
abstract void onKeyLongPress(int key)
```

Called when a key is pressed and held. The length of time between key down and this event is determined by the host and always fires in the following order:

1. Key down
2. Key long press
3. Key up

This event provides the `key` that was pressed in the form of an int constant defined in the `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate` object prefixed with \`KEY_\`.

### onKeyUp

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

```
abstract void onKeyUp(int key)
```

Called when a key is released. This is only called once for each user interaction.

This event provides the `key` that was pressed in the form of an int constant defined in the `https://developer.android.com/reference/androidx/car/app/dialer/TelephoneKeypadTemplate` object prefixed with \`KEY_\`.