mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-29 18:08:19 +00:00
ui: add click helper
This commit is contained in:
parent
e907099be1
commit
f20ce1fcc9
@ -82,6 +82,19 @@ async def alert(count: int=3):
|
|||||||
display.backlight(current)
|
display.backlight(current)
|
||||||
|
|
||||||
|
|
||||||
|
async def click() -> tuple:
|
||||||
|
touch = loop.select(io.TOUCH)
|
||||||
|
while True:
|
||||||
|
ev, *pos = yield touch
|
||||||
|
if ev == io.TOUCH_START:
|
||||||
|
break
|
||||||
|
while True:
|
||||||
|
ev, *pos = yield touch
|
||||||
|
if ev == io.TOUCH_END:
|
||||||
|
break
|
||||||
|
return pos
|
||||||
|
|
||||||
|
|
||||||
async def backlight_slide(val: int, delay: int=20000, step: int=1):
|
async def backlight_slide(val: int, delay: int=20000, step: int=1):
|
||||||
sleep = loop.sleep(delay)
|
sleep = loop.sleep(delay)
|
||||||
current = display.backlight()
|
current = display.backlight()
|
||||||
|
Loading…
Reference in New Issue
Block a user