Keyboard Emulation (ZD)

Table of contents


Description

The action allows you to emulate text input from the keyboard, pressing system buttons (power, sound, etc.)


How to add an action to a project?

Via context menu Add Action -> Android -> Keyboard Emulation

Or use smart search.


What is it used for?

Entering data into text fields, pressing the buttons "Home", "All running applications", "Back", etc.


How to work with an action?

Text

You can enter simple text, variables, and special key macros in the action text box ({AndroidKeys.BACK}, {AndroidKeys.HOME}, {AndroidKeys.CLEAR}).

Key macros

As mentioned above, in this field you can use not only text and variables, but also special macros that emulate some system (and not only) Android buttons.

Below, under the spoiler, macros available in ZennoDroid are described.

Макрос

Действие

Макрос

Действие

{AndroidKeys.APP_SWITCH}

Displays application switcher dialog.

{AndroidKeys.BACK}

Return back

{AndroidKeys.CAMERA}

Camera activation

{AndroidKeys.CLEAR}

Clear input field

{AndroidKeys.COPY}

Copy the selected text to the clipboard.

Only works in emulator based on Android 7.1.

{AndroidKeys.DEL}

A key to delete one character to the left of the cursor.

{AndroidKeys.DOWN}

Emulation of pressing the down arrow on a physical keyboard.

{AndroidKeys.ENTER}

  • newline character

  • submitting a form on sites

  • confirmation of actions in applications

{AndroidKeys.ESCAPE}

Emulation of pressing the Escape key on a physical keyboard.

{AndroidKeys.FORWARD_DEL}

Delete one character to the right of the cursor.

{AndroidKeys.HOME}

Return to Desktop

{AndroidKeys.LEFT}

Emulation of pressing the left arrow on a physical keyboard.

{AndroidKeys.MOVE_END}

  • if the cursor is inside a line, then when this macro is called, it [cursor] will be moved to the end of the line.

  • also this macro can be used to scroll down.

{AndroidKeys.MOVE_HOME}

  • if the cursor is inside a line, then when this macro is called, it [cursor] will be moved to the beginning of the line.

  • also this macro can be used to scroll up.

{AndroidKeys.PAGE_DOWN}

Scroll down the page by screen size

{AndroidKeys.PAGE_UP}

Scroll the page up by the screen size

{AndroidKeys.PASTE}

Paste the contents of the clipboard

Only works in emulator based on Android 7.1.

{AndroidKeys.POWER}

Emulation of pressing the power button

{AndroidKeys.RIGHT}

Emulation of pressing the right arrow on a physical keyboard.

{AndroidKeys.TAB}

Tab key

{AndroidKeys.UP}

Emulation of pressing the up arrow on a physical keyboard.

{AndroidKeys.VOLUME_DOWN}

Decrease volume

{AndroidKeys.VOLUME_UP}

Increase the volume

These are just a few of the available commands. There are others. You can find them using this link, and call them using the Console Command action.

Let's say you want to decrease the brightness of your device. Responsible for this KEYCODE_BRIGHTNESS_DOWN. You can call in two ways:

  1. Through the name of the button (part KEYCODE_ descends) - input keyevent BRIGHTNESS_DOWN

  2. Via digital button code - input keyevent 220

You can find the code at the link indicated above, after the text “Constant Value”:

Delay

Pause between entering characters.

Disable Delay (Instant Text Insertion)

If you remove the checkbox next to the word "Delay", then there will be no pauses between entering characters and the text will be inserted instantly.


Useful links