mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-30 08:20:21 +00:00
389ff92cc1
* Makefile, Scripts: new linter * About: remove ID from IC * Firmware: remove double define for DIVC/DIVR * Scripts: check folder names too. Docker: replace syntax check with make lint. * Reformat Sources and Migrate to new file naming convention * Docker: symlink clang-format-12 to clang-format * Add coding style guide
38 lines
1 KiB
C
38 lines
1 KiB
C
/**
|
|
* @file input.h
|
|
* Input: main API
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <furi_hal_resources.h>
|
|
|
|
/** Input Types
|
|
* Some of them are physical events and some logical
|
|
*/
|
|
typedef enum {
|
|
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 */
|
|
InputTypeRepeat, /**< Repeat event, emmited with INPUT_REPEATE_PRESS period after InputTypeLong event */
|
|
} InputType;
|
|
|
|
/** Input Event, dispatches with FuriPubSub */
|
|
typedef struct {
|
|
uint32_t sequence;
|
|
InputKey key;
|
|
InputType type;
|
|
} InputEvent;
|
|
|
|
/** Get human readable input key name
|
|
* @param key - InputKey
|
|
* @return string
|
|
*/
|
|
const char* input_get_key_name(InputKey key);
|
|
|
|
/** Get human readable input type name
|
|
* @param type - InputType
|
|
* @return string
|
|
*/
|
|
const char* input_get_type_name(InputType type);
|