diff --git a/src/apps/playground/__init__.py b/src/apps/playground/__init__.py index 95ab05b1c6..59dd7273f8 100644 --- a/src/apps/playground/__init__.py +++ b/src/apps/playground/__init__.py @@ -6,9 +6,9 @@ from trezor.utils import unimport_func def multiplex_touch_events(gens): while True: e, (x, y) = yield loop.Wait([ - loop.EVT_TSTART, - loop.EVT_TMOVE, - loop.EVT_TEND, + loop.TOUCH_START, + loop.TOUCH_MOVE, + loop.TOUCH_END, ]) for gen in gens: gen.send((e, (x, y))) @@ -23,7 +23,7 @@ def in_area(pos, area): def click_in(area, enter, leave): while True: e, pos = yield - if e is not loop.EVT_TSTART or not in_area(pos, area): + if e is not loop.TOUCH_START or not in_area(pos, area): continue inside = True @@ -31,7 +31,7 @@ def click_in(area, enter, leave): while True: e, pos = yield - if e is loop.EVT_TMOVE: + if e is loop.TOUCH_MOVE: if in_area(pos, area): if not inside: enter() @@ -40,7 +40,7 @@ def click_in(area, enter, leave): if inside: leave() inside = False - elif e is loop.EVT_TEND: + elif e is loop.TOUCH_END: if in_area(pos, area): return else: diff --git a/src/trezor/loop.py b/src/trezor/loop.py index 72d2d1b2b1..f91794780f 100644 --- a/src/trezor/loop.py +++ b/src/trezor/loop.py @@ -5,16 +5,16 @@ from .utils import type_gen from . import msg from . import log -EVT_TSTART = const(-1) -EVT_TMOVE = const(-2) -EVT_TEND = const(-3) -EVT_MSG = const(-4) +TOUCH_START = const(-1) +TOUCH_MOVE = const(-2) +TOUCH_END = const(-3) +MESSAGE = const(-4) event_handlers = { - EVT_TSTART: None, - EVT_TMOVE: None, - EVT_TEND: None, - EVT_MSG: None, + TOUCH_START: None, + TOUCH_MOVE: None, + TOUCH_END: None, + MESSAGE: None, } time_queue = []