2021-02-10 11:56:05 +03:00
|
|
|
#pragma once
|
2020-10-02 09:44:05 +03:00
|
|
|
|
2021-02-10 11:56:05 +03:00
|
|
|
#include <api-hal-resources.h>
|
2020-10-02 09:44:05 +03:00
|
|
|
|
2021-02-10 11:56:05 +03:00
|
|
|
/* Input Types
|
|
|
|
* Some of them are physical events and some logical
|
|
|
|
*/
|
2020-10-02 09:44:05 +03:00
|
|
|
typedef enum {
|
2021-02-10 11:56:05 +03:00
|
|
|
InputTypePress, /* Press event, emitted after debounce */
|
|
|
|
InputTypeRelease, /* Release event, emitted after debounce */
|
|
|
|
InputTypeShort, /* Short event, emitted after InputTypeRelease done withing INPUT_LONG_PRESS interval */
|
|
|
|
InputTypeLong, /* Long event, emmited after INPUT_LONG_PRESS interval, asynchronouse to InputTypeRelease */
|
2021-04-01 20:10:12 +03:00
|
|
|
InputTypeRepeat, /* Repeat event, emmited with INPUT_REPEATE_PRESS period after InputTypeLong event */
|
2021-02-10 11:56:05 +03:00
|
|
|
} InputType;
|
2020-10-02 09:44:05 +03:00
|
|
|
|
2021-02-10 11:56:05 +03:00
|
|
|
/* Input Event, dispatches with PubSub */
|
2020-10-02 09:44:05 +03:00
|
|
|
typedef struct {
|
2021-02-10 11:56:05 +03:00
|
|
|
InputKey key;
|
|
|
|
InputType type;
|
2020-10-02 09:44:05 +03:00
|
|
|
} InputEvent;
|