# 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
interface TelephoneKeypadCallback
```

<br />

*** ** * ** ***

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

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/dialer/TelephoneKeypadCallback#onKeyDown(int)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Called when a key is pushed. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/dialer/TelephoneKeypadCallback#onKeyLongPress(int)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Called when a key is pressed and held. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/dialer/TelephoneKeypadCallback#onKeyUp(int)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Called when a key is released. |

## Public functions

### onKeyDown

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

```
fun onKeyDown(key: Int): Unit
```

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/kotlin/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)

```
fun onKeyLongPress(key: Int): Unit
```

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/kotlin/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)

```
fun onKeyUp(key: Int): Unit
```

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/kotlin/androidx/car/app/dialer/TelephoneKeypadTemplate` object prefixed with \`KEY_\`.