feat(core): triggering delete action in ChoicePage after 1 second even without release

[no changelog]
This commit is contained in:
grdddj
2023-09-20 15:40:11 +02:00
committed by Jiří Musil
parent ed9fd35018
commit 65c9380ab7
10 changed files with 242 additions and 36 deletions

View File

@@ -649,6 +649,15 @@ class DebugLink:
physical_button=messages.DebugPhysicalButton.MIDDLE_BTN, wait=wait
)
def press_middle_htc(
self, hold_ms: int, extra_ms: int = 200
) -> Optional[LayoutContent]:
return self.press_htc(
button=messages.DebugPhysicalButton.MIDDLE_BTN,
hold_ms=hold_ms,
extra_ms=extra_ms,
)
@overload
def press_right(self) -> None:
...
@@ -664,10 +673,19 @@ class DebugLink:
def press_right_htc(
self, hold_ms: int, extra_ms: int = 200
) -> Optional[LayoutContent]:
return self.press_htc(
button=messages.DebugPhysicalButton.RIGHT_BTN,
hold_ms=hold_ms,
extra_ms=extra_ms,
)
def press_htc(
self, button: messages.DebugPhysicalButton, hold_ms: int, extra_ms: int = 200
) -> Optional[LayoutContent]:
hold_ms = hold_ms + extra_ms # safety margin
result = self.input(
physical_button=messages.DebugPhysicalButton.RIGHT_BTN,
physical_button=button,
hold_ms=hold_ms,
)
# sleeping little longer for UI to update