input.h 1009 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include <furi-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. InputTypeRepeat, /* Repeat event, emmited with INPUT_REPEATE_PRESS period after InputTypeLong event */
  12. } InputType;
  13. /* Input Event, dispatches with PubSub */
  14. typedef struct {
  15. uint32_t sequence;
  16. InputKey key;
  17. InputType type;
  18. } InputEvent;
  19. /** Get human readable input key name
  20. * @param key - InputKey
  21. * @return string
  22. */
  23. const char* input_get_key_name(InputKey key);
  24. /** Get human readable input type name
  25. * @param type - InputType
  26. * @return string
  27. */
  28. const char* input_get_type_name(InputType type);