Skip to main content

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 IDictionary<string, object?> Keyboard(string? text = null, string? key = null, bool hide = false)

The soft keyboard: read it, type at the focused field, press a key, or hide it. With no arguments, 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.

Examples​

Type into the focused field and press Enter​

device.Keyboard(text: "coffee", key: "enter");

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

mobium keyboard --text coffee --key enter on an Android 15 emulator

Hide the keyboard​

device.Keyboard(hide: true);

The same call from the command line, mobium keyboard --hide, printed on an Android 15 emulator:

hid the keyboard
BeforeAfter
Before: mobium keyboard --hide on an Android 15 emulatorAfter: mobium keyboard --hide on an Android 15 emulator

mobium keyboard --hide on an Android 15 emulator