Attempts to detect whether a software keyboard is present Returns: `True` if keyboard is shown
(self)
| 58 | return self |
| 59 | |
| 60 | def is_keyboard_shown(self) -> bool: |
| 61 | """Attempts to detect whether a software keyboard is present |
| 62 | |
| 63 | Returns: |
| 64 | `True` if keyboard is shown |
| 65 | """ |
| 66 | ext_name = 'mobile: isKeyboardShown' |
| 67 | try: |
| 68 | return self.assert_extension_exists(ext_name).execute_script(ext_name) |
| 69 | except UnknownMethodException: |
| 70 | return self.mark_extension_absence(ext_name).execute(Command.IS_KEYBOARD_SHOWN)['value'] |
| 71 | |
| 72 | def keyevent(self, keycode: int, metastate: Optional[int] = None) -> Self: |
| 73 | """Sends a keycode to the device. |