From cd8733e5c865ad66c507cbd93f692ff515d5774a Mon Sep 17 00:00:00 2001 From: "Peter D. Gray" Date: Fri, 26 Jan 2024 10:50:52 -0500 Subject: [PATCH] track new api --- unix/variant/touch.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/unix/variant/touch.py b/unix/variant/touch.py index bb2d9bee..43257c0c 100644 --- a/unix/variant/touch.py +++ b/unix/variant/touch.py @@ -7,7 +7,7 @@ NUM_COLS = const(10) class Touch: - # Misnomer: emulating a membrane now, not a touch interface + # Misnomer: emulating a membrane numpad or qwerty keyboard, not a touch interface # NOTE: doesn't do key repeat well def __init__(self, *a, **kw): @@ -36,11 +36,12 @@ class Touch: # - pad with -1 pressed = await s.read(5) + new_presses = set(kn for kn in pressed if kn!=255 and not numpad.is_pressed[kn]) for kn in range(NUM_ROWS * NUM_COLS): numpad.is_pressed[kn] = (0 if kn not in pressed else 1) # Q1 simulator sends keynumbers, from shared/charcodes.py - numpad.process_chg_state() + numpad.process_chg_state(new_presses) else: # rx's any key that is pressed and now released key = await s.read(1)