Class ButtonCommon
Declaration
class ButtonCommon(object)
source linkMethods
▷ def any(self) Checks if any button is pressed.
▷ def check_buttons(self, buttons=[]) Check if currently pressed buttons exactly match the given list ``buttons``.
▷ def process(self, new_state=None) Check for currenly pressed buttons. If the ``new_state`` differs from the old state, call the appropriate button event handlers (on_up, on_down, etc).
▷ def wait_for_bump(self, buttons, timeout_ms=None) Wait for ``buttons`` to be pressed down and then released. Both actions must happen within ``timeout_ms``.
▷ def wait_for_pressed(self, buttons, timeout_ms=None) Wait for ``buttons`` to be pressed down.
▷ def wait_for_released(self, buttons, timeout_ms=None) Wait for ``buttons`` to be released.
Class methods
▷ def on_change(changed_buttons) @staticmethod This handler is called by ``process()`` whenever state of any button has changed since last ``process()`` call. ``changed_buttons`` is a list of tuples of changed button names and their states.
@staticmethod
def on_change(changed_buttons)