SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
click_type.h
Go to the documentation of this file.
1#ifndef _click_types_H_
2#define _click_types_H_
3
4#include <elapsedMillis.h>
5
6#include "transform.h"
7
8namespace sensesp {
9
22
28class ClickType : public Transform<bool, ClickTypes> {
29 public:
53
59 static bool is_click(ClickTypes value);
60
61 virtual void set_input(bool input, uint8_t input_channel = 0) override;
62 virtual void get_configuration(JsonObject& doc) override;
63 virtual bool set_configuration(const JsonObject& config) override;
64 virtual String get_config_schema() override;
65
66 protected:
71
72 // User Configuration variables...
73
77
81
85
88
91
97
99 void on_button_press();
100
102 void on_button_release();
103
107 void on_ultra_long_click();
108
113 void on_click_completed();
114
121 void emitDelayed(ClickTypes value);
122};
123
124} // namespace sensesp
125
126#endif
ClickType is a transform that consumes button clicks and translates them as events of type ClickTypes...
Definition click_type.h:28
void emitDelayed(ClickTypes value)
elapsedMillis press_duration_
Timmer to time button presses.
Definition click_type.h:87
elapsedMillis release_duration_
Timer to time interval between button releases.
Definition click_type.h:90
uint16_t long_click_delay_
Definition click_type.h:76
virtual void get_configuration(JsonObject &doc) override
DelayReaction * delayed_click_report_
Definition click_type.h:96
uint16_t double_click_interval_
Definition click_type.h:84
virtual String get_config_schema() override
void on_button_press()
Processes incoming values that represent a "ButonPress" event.
void on_button_release()
Processes incoming value that represent a "ButtonRelease" event.
virtual void set_input(bool input, uint8_t input_channel=0) override
virtual bool set_configuration(const JsonObject &config) override
static bool is_click(ClickTypes value)
uint16_t ultra_long_click_delay_
Definition click_type.h:80
Construct a new transform based on a single function.
The main Transform class. A transform is identified primarily by the type of value that is produces (...
Definition transform.h:54