Package 

Class KeyboardImpl

  • All Implemented Interfaces:
    com.kaspersky.kaspresso.device.keyboard.Keyboard

    
    public final class KeyboardImpl
     implements Keyboard
                        

    The implementation of the Keyboard interface.

    • Method Summary

      Modifier and Type Method Description
      Unit typeText(String text) Types text char by char in the focused text field.
      Unit sendEvent(Integer keyEvent) Sends a key event.
      • Methods inherited from class com.kaspersky.kaspresso.device.keyboard.Keyboard

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KeyboardImpl

        KeyboardImpl(AdbServer adbServer)
    • Method Detail

      • typeText

         Unit typeText(String text)

        Types text char by char in the focused text field. Use it only when Espresso or UiAutomator are not appropriate (e.g. when you are on the lock screen).

        Consider to use ViewActions.typeText. Also, consider to use UiObject.setText.

        Required Permissions: INTERNET

      • sendEvent

         Unit sendEvent(Integer keyEvent)

        Sends a key event. Use constants from KeyEvent to get the code.

        Consider to use ViewActions.pressKey. Also, consider to use UiDevice.pressKeyCode, or more semantic methods like UiDevice.pressMenu, UiDevice.pressDPadLeft and so on.

        Required Permissions: INTERNET

        Parameters:
        keyEvent - the code from a KeyEvent constant to send on device.