7static const char *
const TAG =
"matrix_keypad";
10 for (
auto *pin : this->
rows_) {
32 int pos = 0, row, col;
33 for (
auto *row : this->
rows_) {
58 ESP_LOGD(TAG,
"key @ row %d, col %d released", row, col);
60 listener->button_released(row, col);
63 ESP_LOGD(TAG,
"key '%c' released", keycode);
64 for (
auto &listener : this->listeners_)
65 listener->key_released(keycode);
81 ESP_LOGD(TAG,
"key @ row %d, col %d pressed", row, col);
83 listener->button_pressed(row, col);
84 if (key < (
int) this->
keys_.size()) {
85 uint8_t keycode = this->
keys_[key];
86 ESP_LOGD(TAG,
"key '%c' pressed", keycode);
88 trigger->trigger(keycode);
89 for (
auto &listener : this->listeners_)
90 listener->key_pressed(keycode);
97 ESP_LOGCONFIG(TAG,
"Matrix Keypad:\n"
99 for (
auto &pin : this->
rows_) {
100 LOG_PIN(
" Pin: ", pin);
102 ESP_LOGCONFIG(TAG,
" Cols:");
104 LOG_PIN(
" Pin: ", pin);
uint32_t IRAM_ATTR HOT get_loop_component_start_time() const
Get the cached time in milliseconds from when the current component started its loop execution.
void send_key_(uint8_t key)
std::vector< MatrixKeypadListener * > listeners_
void register_key_trigger(MatrixKeyTrigger *trig)
std::vector< GPIOPin * > columns_
std::vector< MatrixKeyTrigger * > key_triggers_
void dump_config() override
std::vector< GPIOPin * > rows_
void register_listener(MatrixKeypadListener *listener)
Application App
Global storage of Application pointer - only one Application can exist.