PressKeyCode Method (MobileDevice)

Action

Presses a certain Android-specific key code. This method is not supported on iOS.

For additional information about the supported Android key codes, refer to the Appium documentation.

Syntax

C#
device.PressKeyCode(keyCode, [metaState])
VB
device.PressKeyCode(keyCode, [metaState])
Variable Description
keyCode The desired key code to press. Integer.
metaState Optional: the meta state of a key code. For example:
  • 1 = Shift
  • 2 = Alt
  • 4096 = Ctrl
For additional information about the supported meta states, refer to the Appium documentation. Integer.