# EspressoKey.Builder

Summary:[Ctors](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder#pubctors)\|[Methods](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder#)  

# EspressoKey.Builder

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public
static


class
EspressoKey.Builder
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object.html)`


``


`

|---|----------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||
| ↳ | android.support.test.espresso.action.EspressoKey.Builder |

<br />

*** ** * ** ***

Builder for the EspressoKey class.

## Summary

|                                                                 ### Public constructors                                                                  ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[EspressoKey.Builder](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder#EspressoKey.Builder())`() ` |

|                                                                                                                                                                              ### Public methods                                                                                                                                                                               ||
|----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[EspressoKey](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey)                 | ` `[build](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder#build())`() `                                                                                                                         |
| ` `[EspressoKey.Builder](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder) | ` `[withAltPressed](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder#withAltPressed(boolean))`(boolean altPressed) ` Sets the ALT_ON meta state of the resulting key.                             |
| ` `[EspressoKey.Builder](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder) | ` `[withCtrlPressed](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder#withCtrlPressed(boolean))`(boolean ctrlPressed) ` On Honeycomb and above, sets the CTRL_ON meta state of the resulting key. |
| ` `[EspressoKey.Builder](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder) | ` `[withKeyCode](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder#withKeyCode(int))`(int keyCode) `                                                                                               |
| ` `[EspressoKey.Builder](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder) | ` `[withShiftPressed](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder#withShiftPressed(boolean))`(boolean shiftPressed) ` Sets the SHIFT_ON meta state of the resulting key.                     |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder#)From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)` ` |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                                | | ` boolean`                                                                          | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                             | ` finalize() `                                                                             | | ` final `[Class](https://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                             | | ` int`                                                                              | ` hashCode() `                                                                             | | ` final void`                                                                       | ` notify() `                                                                               | | ` final void`                                                                       | ` notifyAll() `                                                                            | | ` `[String](https://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                             | | ` final void`                                                                       | ` wait(long arg0, int arg1) `                                                              | | ` final void`                                                                       | ` wait(long arg0) `                                                                        | | ` final void`                                                                       | ` wait() `                                                                                 | ||

## Public constructors

### EspressoKey.Builder

```
EspressoKey.Builder ()
```

<br />

<br />

## Public methods

### build

```
EspressoKey build ()
```

<br />

<br />

|                                                     Returns                                                     ||
|---------------------------------------------------------------------------------------------------------|--------|
| [EspressoKey](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey) | <br /> |

### withAltPressed

```
EspressoKey.Builder withAltPressed (boolean altPressed)
```

Sets the ALT_ON meta state of the resulting key.

<br />

|           Parameters           ||
|--------------|------------------|
| `altPressed` | `boolean` <br /> |

|                                                             Returns                                                             ||
|-------------------------------------------------------------------------------------------------------------------------|--------|
| [EspressoKey.Builder](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder) | <br /> |

### withCtrlPressed

```
EspressoKey.Builder withCtrlPressed (boolean ctrlPressed)
```

On Honeycomb and above, sets the CTRL_ON meta state of the resulting key. On Gingerbread and below, this is a noop.

<br />

|           Parameters            ||
|---------------|------------------|
| `ctrlPressed` | `boolean` <br /> |

|                                                             Returns                                                             ||
|-------------------------------------------------------------------------------------------------------------------------|--------|
| [EspressoKey.Builder](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder) | <br /> |

### withKeyCode

```
EspressoKey.Builder withKeyCode (int keyCode)
```

<br />

<br />

|       Parameters        ||
|-----------|--------------|
| `keyCode` | `int` <br /> |

|                                                             Returns                                                             ||
|-------------------------------------------------------------------------------------------------------------------------|--------|
| [EspressoKey.Builder](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder) | <br /> |

### withShiftPressed

```
EspressoKey.Builder withShiftPressed (boolean shiftPressed)
```

Sets the SHIFT_ON meta state of the resulting key.

<br />

|            Parameters            ||
|----------------|------------------|
| `shiftPressed` | `boolean` <br /> |

|                                                             Returns                                                             ||
|-------------------------------------------------------------------------------------------------------------------------|--------|
| [EspressoKey.Builder](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder) | <br /> |

-

  ## Interfaces

  - [AdapterViewProtocol](https://developer.android.com/reference/android/support/test/espresso/action/AdapterViewProtocol)
  - [AdapterViewProtocol.DataFunction](https://developer.android.com/reference/android/support/test/espresso/action/AdapterViewProtocol.DataFunction)
  - [CoordinatesProvider](https://developer.android.com/reference/android/support/test/espresso/action/CoordinatesProvider)
  - [PrecisionDescriber](https://developer.android.com/reference/android/support/test/espresso/action/PrecisionDescriber)
  - [Swiper](https://developer.android.com/reference/android/support/test/espresso/action/Swiper)
  - [Tapper](https://developer.android.com/reference/android/support/test/espresso/action/Tapper)
-

  ## Classes

  - [AdapterDataLoaderAction](https://developer.android.com/reference/android/support/test/espresso/action/AdapterDataLoaderAction)
  - [AdapterViewProtocol.AdaptedData](https://developer.android.com/reference/android/support/test/espresso/action/AdapterViewProtocol.AdaptedData)
  - [AdapterViewProtocol.AdaptedData.Builder](https://developer.android.com/reference/android/support/test/espresso/action/AdapterViewProtocol.AdaptedData.Builder)
  - [AdapterViewProtocols](https://developer.android.com/reference/android/support/test/espresso/action/AdapterViewProtocols)
  - [CloseKeyboardAction](https://developer.android.com/reference/android/support/test/espresso/action/CloseKeyboardAction)
  - [EditorAction](https://developer.android.com/reference/android/support/test/espresso/action/EditorAction)
  - [EspressoKey](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey)
  - [EspressoKey.Builder](https://developer.android.com/reference/android/support/test/espresso/action/EspressoKey.Builder)
  - [GeneralClickAction](https://developer.android.com/reference/android/support/test/espresso/action/GeneralClickAction)
  - [GeneralSwipeAction](https://developer.android.com/reference/android/support/test/espresso/action/GeneralSwipeAction)
  - [KeyEventAction](https://developer.android.com/reference/android/support/test/espresso/action/KeyEventAction)
  - [MotionEvents](https://developer.android.com/reference/android/support/test/espresso/action/MotionEvents)
  - [MotionEvents.DownResultHolder](https://developer.android.com/reference/android/support/test/espresso/action/MotionEvents.DownResultHolder)
  - [OpenLinkAction](https://developer.android.com/reference/android/support/test/espresso/action/OpenLinkAction)
  - [PressBackAction](https://developer.android.com/reference/android/support/test/espresso/action/PressBackAction)
  - [RepeatActionUntilViewState](https://developer.android.com/reference/android/support/test/espresso/action/RepeatActionUntilViewState)
  - [ReplaceTextAction](https://developer.android.com/reference/android/support/test/espresso/action/ReplaceTextAction)
  - [ScrollToAction](https://developer.android.com/reference/android/support/test/espresso/action/ScrollToAction)
  - [TypeTextAction](https://developer.android.com/reference/android/support/test/espresso/action/TypeTextAction)
  - [ViewActions](https://developer.android.com/reference/android/support/test/espresso/action/ViewActions)
-

  ## Enums

  - [GeneralLocation](https://developer.android.com/reference/android/support/test/espresso/action/GeneralLocation)
  - [Press](https://developer.android.com/reference/android/support/test/espresso/action/Press)
  - [Swipe](https://developer.android.com/reference/android/support/test/espresso/action/Swipe)
  - [Swiper.Status](https://developer.android.com/reference/android/support/test/espresso/action/Swiper.Status)
  - [Tap](https://developer.android.com/reference/android/support/test/espresso/action/Tap)
  - [Tapper.Status](https://developer.android.com/reference/android/support/test/espresso/action/Tapper.Status)