flipperzero-firmware/applications/input/input.h
Anna Prosvetova e9e76e144c
RPC: Implement storage_stat_request (#800)
* RPC: Update protobuf sources
* RPC: Implement storage_stat_request
* RPC: Test storage_stat_request
* FuriRecord: fix use after free in destroy method.
* Furi: refactor PubSub and it's usage. Fix allocation in RPC.
* FuriCore: fix memory leak in pubsub
* FuriCore: update unsubscribe method signature in pubsub, make subscription structure lighter.
* FuriCore: remove dead code

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-11-01 23:35:54 +03:00

39 lines
1.0 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);