BSB Developer Docs
Loading...
Searching...
No Matches
input.h
Go to the documentation of this file.
1
5#pragma once
6
7#include "input_common.h"
8
9#include <furi_hal_resources.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#define RECORD_INPUT "input"
16#define RECORD_INPUT_EVENTS "input_events"
17
18#define INPUT_SEQUENCE_SOURCE_HARDWARE (0U)
19#define INPUT_SEQUENCE_SOURCE_SOFTWARE (1U)
20
32
34typedef struct {
35 InputKey key;
36 InputType type;
37 uint8_t sequence_source;
38 uint32_t sequence_number;
40
45const char* input_get_key_name(InputKey key);
46
51const char* input_get_type_name(InputType type);
52
59void input_key_press(Input* input, InputKey key);
60
67void input_key_release(Input* input, InputKey key);
68
77void input_key_toggle(Input* input, InputKey key);
78
88FuriState* input_get_switch_pos(Input* input);
89
90#ifdef __cplusplus
91}
92#endif
InputKey
Definition f21/furi_hal/furi_hal_resources.h:14
void input_key_toggle(Input *input, InputKey key)
Toggle the state of a key.
Definition input.c:317
void input_key_press(Input *input, InputKey key)
Set the pressed state of a key.
Definition input.c:307
void input_key_release(Input *input, InputKey key)
Set the released state of a key.
Definition input.c:312
InputType
Input Types Some of them are physical events and some logical.
Definition input.h:24
@ InputTypeShort
Short event, emitted after InputTypeRelease done within INPUT_LONG_PRESS interval.
Definition input.h:27
@ InputTypeRepeat
Repeat event, emitted with INPUT_LONG_PRESS_COUNTS period after InputTypeLong event.
Definition input.h:29
@ InputTypeRelease
Release event, emitted after debounce.
Definition input.h:26
@ InputTypeMAX
Special value, internal use.
Definition input.h:30
@ InputTypePress
Press event, emitted after debounce.
Definition input.h:25
@ InputTypeLong
Long event, emitted after INPUT_LONG_PRESS_COUNTS interval, asynchronous to InputTypeRelease
Definition input.h:28
FuriState * input_get_switch_pos(Input *input)
Get the reference to a FuriState with the mode switch position.
Definition input.c:323
const char * input_get_type_name(InputType type)
Get human readable input type name.
Definition input.c:80
const char * input_get_key_name(InputKey key)
Get human readable input key name.
Definition input.c:49
Input Event, dispatches with FuriPubSub.
Definition input.h:34
Input state.
Definition input.c:35