The touchpads API allows you to call functions when someone presses a touchpad.

Available on:    ✅ CampZone 2020


import touchpads

def on_left(is_pressed):
    print('Left button: ' + is_pressed)

def on_ok(is_pressed):
    print('OK button: ' + is_pressed)

touchpads.on(touchpads.LEFT, on_left)
touchpads.on(touchpads.OK, on_ok)


ontouchpad, callback-Set a callback that gets called whenever the given touchpad touch state changes. First argument to this function is the pressed state. Touchpad can be touchpads.LEFT, RIGHT, HOME, CANCEL, or OK.
offtouchpad-Remove a previously set callback.
Last modified September 3, 2023: Add note about case and frontpanel (0dc8959)