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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"key": "<key>"
},
"name": "key_event"
}
}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. |