BSB Developer Docs
Loading...
Searching...
No Matches
input.h File Reference

Input: main API. More...

#include "input_common.h"
#include <furi_hal_resources.h>

Go to the source code of this file.

Data Structures

struct  InputEvent
 Input Event, dispatches with FuriPubSub. More...
 

Macros

#define RECORD_INPUT   "input"
 
#define RECORD_INPUT_EVENTS   "input_events"
 
#define INPUT_SEQUENCE_SOURCE_HARDWARE   (0U)
 
#define INPUT_SEQUENCE_SOURCE_SOFTWARE   (1U)
 

Enumerations

enum  InputType {
  InputTypePress , InputTypeRelease , InputTypeShort , InputTypeLong ,
  InputTypeRepeat , InputTypeMAX
}
 Input Types Some of them are physical events and some logical. More...
 

Functions

const char * input_get_key_name (InputKey key)
 Get human readable input key name.
 
const char * input_get_type_name (InputType type)
 Get human readable input type name.
 
void input_key_press (Input *input, InputKey key)
 Set the pressed state of a key.
 
void input_key_release (Input *input, InputKey key)
 Set the released state of a key.
 
void input_key_toggle (Input *input, InputKey key)
 Toggle the state of a key.
 
FuriState * input_get_switch_pos (Input *input)
 Get the reference to a FuriState with the mode switch position.
 

Detailed Description

Input: main API.

Input: f64 side API.

Enumeration Type Documentation

◆ InputType

enum InputType

Input Types Some of them are physical events and some logical.

Enumerator
InputTypePress 

Press event, emitted after debounce.

InputTypeRelease 

Release event, emitted after debounce.

InputTypeShort 

Short event, emitted after InputTypeRelease done within INPUT_LONG_PRESS interval.

InputTypeLong 

Long event, emitted after INPUT_LONG_PRESS_COUNTS interval, asynchronous to InputTypeRelease

InputTypeRepeat 

Repeat event, emitted with INPUT_LONG_PRESS_COUNTS period after InputTypeLong event.

InputTypeMAX 

Special value, internal use.

Function Documentation

◆ input_get_key_name()

const char * input_get_key_name ( InputKey key)

Get human readable input key name.

Parameters
key- InputKey
Returns
string

◆ input_get_switch_pos()

FuriState * input_get_switch_pos ( Input * input)

Get the reference to a FuriState with the mode switch position.

The FuriState stores a InputSwitchPosition type. InputSwitchPositionMAX means that state is unknown yet.

Parameters
[in]inputInput instance
Returns
FuriState as described above.

◆ input_get_type_name()

const char * input_get_type_name ( InputType type)

Get human readable input type name.

Parameters
type- InputType
Returns
string

◆ input_key_press()

void input_key_press ( Input * input,
InputKey key )

Set the pressed state of a key.

Parameters
[in]inputInput instance
[in]keyKey

◆ input_key_release()

void input_key_release ( Input * input,
InputKey key )

Set the released state of a key.

Parameters
[in]inputInput instance
[in]keyKey

◆ input_key_toggle()

void input_key_toggle ( Input * input,
InputKey key )

Toggle the state of a key.

Set the pressed and the released state of a key in a quick succession

Parameters
[in]inputInput instance
[in]keyKey