jacdac.matrix_keypad

Submodules

Package Contents

Classes

MatrixKeypadClient

A matrix of buttons connected as a keypad

class jacdac.matrix_keypad.MatrixKeypadClient(bus: jacdac.bus.Bus, role: str)

Bases: jacdac.bus.Client

A matrix of buttons connected as a keypad Implements a client for the Matrix Keypad service.

property rows Optional[int]

Number of rows in the matrix, _: #

property columns Optional[int]

Number of columns in the matrix, _: #

property variant Optional[jacdac.matrix_keypad.constants.MatrixKeypadVariant]

(Optional) The type of physical keypad. If the variant is ElastomerLEDPixel and the next service on the device is a LEDPixel service, it is considered as the service controlling the LED pixel on the keypad.,

on_down(handler: jacdac.bus.EventHandlerFn) jacdac.bus.UnsubscribeFn

Emitted when a key, at the given index, goes from inactive (pressed == 0) to active.

on_up(handler: jacdac.bus.EventHandlerFn) jacdac.bus.UnsubscribeFn

Emitted when a key, at the given index, goes from active (pressed == 1) to inactive.

on_click(handler: jacdac.bus.EventHandlerFn) jacdac.bus.UnsubscribeFn

Emitted together with up when the press time was not longer than 500ms.

on_long_click(handler: jacdac.bus.EventHandlerFn) jacdac.bus.UnsubscribeFn

Emitted together with up when the press time was more than 500ms.