input.h 608 B

12345678910111213141516171819
  1. #pragma once
  2. #include <api-hal-resources.h>
  3. /* Input Types
  4. * Some of them are physical events and some logical
  5. */
  6. typedef enum {
  7. InputTypePress, /* Press event, emitted after debounce */
  8. InputTypeRelease, /* Release event, emitted after debounce */
  9. InputTypeShort, /* Short event, emitted after InputTypeRelease done withing INPUT_LONG_PRESS interval */
  10. InputTypeLong, /* Long event, emmited after INPUT_LONG_PRESS interval, asynchronouse to InputTypeRelease */
  11. } InputType;
  12. /* Input Event, dispatches with PubSub */
  13. typedef struct {
  14. InputKey key;
  15. InputType type;
  16. } InputEvent;