Skip to content

Commit

Permalink
Fix: ime not shown when enter input mode
Browse files Browse the repository at this point in the history
  • Loading branch information
guoh064 committed May 24, 2024
1 parent affc053 commit 86044c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions module/device/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@


class Input(Uiautomator2):
def ime_shown(self) -> bool:
_, shown = self.u2_current_ime()
return shown

def text_input_and_confirm(self, text: str, clear: bool=False):
for fail_count in range(3):
try:
Expand Down
3 changes: 3 additions & 0 deletions module/device/method/uiautomator_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ def u2_shell_background(self, cmdline, timeout=10) -> ShellBackgroundResponse:
def u2_set_fastinput_ime(self, enable: bool):
self.u2.set_fastinput_ime(enable)

def u2_current_ime(self):
return self.u2.current_ime()

def u2_send_keys(self, text: str, clear: bool=False):
self.u2.send_keys(text=text, clear=clear)

Expand Down
2 changes: 1 addition & 1 deletion module/equipment/equipment_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def enter_equip_code_input_mode(self, skip_first_screenshot=True):
continue

# End
if not self.appear(EQUIPMENT_CODE_ENTER):
if self.device.ime_shown():
break

def confirm_equip_code(self, skip_first_screenshot=False):
Expand Down

0 comments on commit 86044c5

Please sign in to comment.