| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- from typing import Callable
- INPUT_BUTTON_UP: int
- """
- Constant value for the `up` button.
- .. versionadded:: 1.0.0
- """
- INPUT_BUTTON_DOWN: int
- """
- Constant value for the `down` button.
- .. versionadded:: 1.0.0
- """
- INPUT_BUTTON_RIGHT: int
- """
- Constant value for the `right` button.
- .. versionadded:: 1.0.0
- """
- INPUT_BUTTON_LEFT: int
- """
- Constant value for the `left` button.
- .. versionadded:: 1.0.0
- """
- INPUT_BUTTON_OK: int
- """
- Constant value for the `ok` button.
- .. versionadded:: 1.0.0
- """
- INPUT_BUTTON_BACK: int
- """
- Constant value for the `back` button.
- .. versionadded:: 1.0.0
- """
- INPUT_TYPE_PRESS: int
- """
- Constant value for the `press` event of a button.
- .. versionadded:: 1.0.0
- """
- INPUT_TYPE_RELEASE: int
- """
- Constant value for the `release` event of a button.
- .. versionadded:: 1.0.0
- """
- INPUT_TYPE_SHORT: int
- """
- Constant value for the `short` press event of a button.
- .. versionadded:: 1.0.0
- """
- INPUT_TYPE_LONG: int
- """
- Constant value for the `long` press event of a button.
- .. versionadded:: 1.0.0
- """
- INPUT_TYPE_REPEAT: int
- """
- Constant value for the `repeat` press event of a button.
- .. versionadded:: 1.0.0
- """
- def on_input() -> Callable[[int, int], None]:
- """
- Decorate a function to be used as input handler. The decorated function will be invoked upon interaction with one of the buttons on the Flipper.
- .. versionadded:: 1.0.0
- .. code-block::
- import flipperzero as f0
- @f0.on_input
- def input_handler(button, type):
- if button == f0.INPUT_BUTTON_BACK:
- if type == f0.INPUT_TYPE_LONG:
- ...
- .. warning::
- You can only decorate one function per application.
- """
- pass
|