keyboard
This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET
The soft keyboard: whether it is up and which field has focus, typing at that field's cursor, pressing a named key, or hiding it. These call app_keyboard.
keyboard
public Map<String, Object> keyboard(String text, String key, boolean hide)
The soft keyboard: read it, type at the focused field, press a key, or
hide it. With nulls and false, returns shown and the
focused field — a password's value is never shown. Text is added
to the end of the focused field and confirmed; key is "enter", "delete"
or "space", after any text; hide hides the keyboard, confirmed, alone.
Throws NoSuchElementException when nothing has focus.
@param text text to add at the end of the focused field, or null
@param key "enter", "delete" or "space", or null
@param hide whether to hide the keyboard
@return whether the keyboard is shown, and the focused field
Examples
Type into the focused field and press Enter
device.keyboard("coffee", "enter", false);
The same call from the command line, mobium keyboard --text coffee --key enter, printed on an Android 15 emulator:
typed "coffee" into username, which now holds coffee; the keyboard is hidden

mobium keyboard --text coffee --key enter on an Android 15 emulator
Hide the keyboard
device.keyboard(null, null, true);
The same call from the command line, mobium keyboard --hide, printed on an Android 15 emulator:
hid the keyboard
| Before | After |
|---|---|
![]() | ![]() |
mobium keyboard --hide on an Android 15 emulator

