Class KeyEvent
- java.lang.Object
-
- io.appium.java_client.android.nativekey.KeyEvent
-
public class KeyEvent extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description KeyEvent()
KeyEvent(AndroidKey key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
build()
Builds a map, which is ready to be used by the downstream API.KeyEvent
withFlag(KeyEventFlag keyEventFlag)
Adds the flag.KeyEvent
withKey(AndroidKey key)
Sets the key code.KeyEvent
withMetaModifier(KeyEventMetaModifier keyEventMetaModifier)
Adds the meta modifier.
-
-
-
Constructor Detail
-
KeyEvent
public KeyEvent()
-
KeyEvent
public KeyEvent(AndroidKey key)
-
-
Method Detail
-
withKey
public KeyEvent withKey(AndroidKey key)
Sets the key code. This code is mandatory.- Parameters:
key
- Native Android key.- Returns:
- self instance for chaining
-
withMetaModifier
public KeyEvent withMetaModifier(KeyEventMetaModifier keyEventMetaModifier)
Adds the meta modifier.- Parameters:
keyEventMetaModifier
- Native Android modifier value. Multiple modifiers can be combined into a single key event.- Returns:
- self instance for chaining
-
withFlag
public KeyEvent withFlag(KeyEventFlag keyEventFlag)
Adds the flag.- Parameters:
keyEventFlag
- Native Android flag value. Several flags can be combined into a single key event.- Returns:
- self instance for chaining
-
build
public java.util.Map<java.lang.String,java.lang.Object> build()
Builds a map, which is ready to be used by the downstream API.- Returns:
- API parameters mapping
- Throws:
java.lang.IllegalStateException
- if key code is not set
-
-