Text Input Actions
ActionsKeyboard input and clipboard operations
Access these methods through agent.actions. Type text, manage clipboard, and handle keyboard interactions.
writeText()
writeText(text: string): Promise<void>Types text using keyboard input. The keyboard must be visible.
Parameters
| Name | Type | Description |
|---|---|---|
text | string | Text to type |
Returns
Promise<void>Resolves when text is typed
Examples
await agent.actions.writeText("Hello World");copyText()
copyText(text: string): Promise<void>Copies the specified text to the system clipboard.
Parameters
| Name | Type | Description |
|---|---|---|
text | string | Text to copy to clipboard |
Returns
Promise<void>Resolves when copy is complete
Examples
await agent.actions.copyText("Text to copy");paste()
paste(): Promise<void>Pastes content from the clipboard at the current cursor position.
Returns
Promise<void>Resolves when paste is complete
Examples
await agent.actions.paste();reverseCopy()
reverseCopy(): Promise<{text: string, data?: any, files?: {uri: string, mimeType: string, name: string, dataBase64: string}[]}>Gets the current clipboard content including text, data, and files.
Returns
{text, data?, files?}Clipboard content with text and optional binary data/files
Examples
const clipboard = await agent.actions.reverseCopy();console.log(clipboard.text);if (clipboard.files) { console.log("Files:", clipboard.files.map(f => f.name));}hideKeyboard()
hideKeyboard(): Promise<void>Hides the software keyboard if it's currently visible.
Returns
Promise<void>Resolves when keyboard is hidden
Examples
await agent.actions.hideKeyboard();inputKey()
inputKey(keyCode: number, duration?: number, state?: "down" | "up" | null): Promise<void>Sends a raw key event by Android KeyEvent code. Requires Android 13+ (SDK level 33+) and only works when the on-screen keyboard is visible.
Parameters
| Name | Type | Description |
|---|---|---|
keyCode | number | Android KeyEvent code (e.g., 66 for ENTER) |
duration? | number | Press duration in ms |
state? | "down" | "up" | null | "down" for press, "up" for release, null for full press |
Returns
Promise<void>Resolves when key event is sent
Examples
await agent.actions.inputKey(66);await agent.actions.inputKey(66, 500, "down");Note: inputKey() requires Android 13+ (SDK level 33+) and will only work when the on-screen keyboard is visible. Tap on an input field first to show the keyboard.