Send a key event
key_eventSend a single Android key event to a connected device by named key or keycode 0-300 for navigation, power, volume, and wake/sleep control.
Instructions
Send one key event to the device (input keyevent <code>). Pass a named key (HOME, BACK, ENTER, DEL, MENU, POWER, VOLUME_UP, VOLUME_DOWN, TAB, ESCAPE, APP_SWITCH, WAKEUP, SLEEP) or a raw Android keycode 0-300. Use WAKEUP (or POWER) before driving a screen that may be off, and BACK/HOME to navigate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Android keycode 0-300, or a named key: HOME, BACK, ENTER, DEL, MENU, POWER, VOLUME_UP, VOLUME_DOWN, TAB, ESCAPE, APP_SWITCH, WAKEUP, SLEEP. | |
| device | No | Device serial from list_devices; optional when exactly one device is connected. |