touch_keypad
touch_keypad ¶
touch_keypad¶
Matrix keypad helper for touch displays on displaysys.
Divides the display into a grid of rows and columns. Returns the key number of the associated cell pressed.
Also passes through the key from any KEYDOWN events from the display.
Usage: from touch_keypad import Keypad from board_config import display_drv, broker
keys = [1, 2, 3, "A", "B", "C", "play", "pause", "esc"] keypad = Keypad(broker.poll, 0, 0, display_drv.width, display_drv.height, cols=3, rows=3, keys=keys) while True: broker.poll() if keys := keypad.read(): print(keys) # For held-key polling (e.g. continuous movement), use keypad.read_held()