def handle_click(click, **callbacks):
    """Handle `click` as returned by `delay.wait_for_clicks`

    `callbacks` maps 'buttonN' keys to callables, N being the number of a
    mouse button starting at 1.

    `click` is passed on to the callback.
    """
    if click is None:
        return
    else:
        button = 'button' + str(click.get('button'))
        try:
            callback = callbacks[button]
        except KeyError:
            pass
        else:
            callback(click)
