10#ifndef M5_UNIT_KEYBOARD_UNIT_FACES_QWERTY_HPP
11#define M5_UNIT_KEYBOARD_UNIT_FACES_QWERTY_HPP
34class UnitFacesQWERTY :
public UnitKeyboardBitwise {
35 M5_UNIT_COMPONENT_HPP_BUILDER(UnitFacesQWERTY, 0x08);
38 static constexpr uint8_t NUMBER_OF_KEYS{35};
42 static constexpr keyboard::key_index_t KEY_Q{0};
43 static constexpr keyboard::key_index_t KEY_W{1};
44 static constexpr keyboard::key_index_t KEY_E{2};
45 static constexpr keyboard::key_index_t KEY_R{3};
46 static constexpr keyboard::key_index_t KEY_T{4};
47 static constexpr keyboard::key_index_t KEY_Y{5};
48 static constexpr keyboard::key_index_t KEY_U{6};
49 static constexpr keyboard::key_index_t KEY_I{7};
50 static constexpr keyboard::key_index_t KEY_O{8};
51 static constexpr keyboard::key_index_t KEY_P{9};
52 static constexpr keyboard::key_index_t KEY_A{10};
53 static constexpr keyboard::key_index_t KEY_S{11};
54 static constexpr keyboard::key_index_t KEY_D{12};
55 static constexpr keyboard::key_index_t KEY_F{13};
56 static constexpr keyboard::key_index_t KEY_G{14};
57 static constexpr keyboard::key_index_t KEY_H{15};
58 static constexpr keyboard::key_index_t KEY_J{16};
59 static constexpr keyboard::key_index_t KEY_K{17};
60 static constexpr keyboard::key_index_t KEY_L{18};
61 static constexpr keyboard::key_index_t KEY_BS{19};
62 static constexpr keyboard::key_index_t KEY_NO_KEY_ALT{20};
63 static constexpr keyboard::key_index_t KEY_Z{21};
64 static constexpr keyboard::key_index_t KEY_X{22};
65 static constexpr keyboard::key_index_t KEY_C{23};
66 static constexpr keyboard::key_index_t KEY_V{24};
67 static constexpr keyboard::key_index_t KEY_B{25};
68 static constexpr keyboard::key_index_t KEY_N{26};
69 static constexpr keyboard::key_index_t KEY_M{27};
70 static constexpr keyboard::key_index_t KEY_DOLLAR{28};
71 static constexpr keyboard::key_index_t KEY_ENTER{29};
72 static constexpr keyboard::key_index_t KEY_NO_KEY_SHIFT{30};
73 static constexpr keyboard::key_index_t KEY_0{31};
74 static constexpr keyboard::key_index_t KEY_SPACE{32};
75 static constexpr keyboard::key_index_t KEY_NO_KEY_SYM{33};
76 static constexpr keyboard::key_index_t KEY_NO_KEY_FN{34};
81 static constexpr char SCHAR_NOMARK_G{
static_cast<char>(180)};
82 static constexpr char SCHAR_NOMARK_H{
static_cast<char>(181)};
83 static constexpr char SCHAR_NOMARK_J{
static_cast<char>(182)};
84 static constexpr char SCHAR_UP{
static_cast<char>(183)};
85 static constexpr char SCHAR_INS{
static_cast<char>(184)};
86 static constexpr char SCHAR_HOME{
static_cast<char>(187)};
87 static constexpr char SCHAR_END{
static_cast<char>(188)};
88 static constexpr char SCHAR_PAGE_UP{
static_cast<char>(189)};
89 static constexpr char SCHAR_PAGE_DOWN{
static_cast<char>(190)};
90 static constexpr char SCHAR_LEFT{
static_cast<char>(191)};
91 static constexpr char SCHAR_DOWN{
static_cast<char>(192)};
92 static constexpr char SCHAR_RIGHT{
static_cast<char>(193)};
93 static constexpr char SCHAR_SPEAKER{
static_cast<char>(194)};
120 _repeat_start_at.resize(NUMBER_OF_KEYS);
121 _hold_start_at.resize(NUMBER_OF_KEYS);
124 virtual bool begin()
override;
126 virtual void update(
const bool force =
false)
override;
181#if defined(DOXYGEN_PROCESS)
188 bool update_new_firmware(
const types::elapsed_time_t at);
189 void push_back(m5::container::CircularBuffer<uint8_t>* container,
const uint8_t kidx,
const uint8_t mod8);
191 inline virtual uint8_t to_mode_bits(
const char ch)
const override
205constexpr uint8_t CMD_FACES_TYPE_REG{0xFC};
QWERTY is a full-featured keyboard panel adapted to FACE_BOTTOM.
config_t config()
Gets the configuration.
Definition unit_FacesQWERTY.hpp:131
static keyboard::key_index_t character_to_key_index(const char ch)
Character to key index.
Definition unit_FacesQWERTY.cpp:232
virtual void update(const bool force=false) override
Definition unit_FacesQWERTY.cpp:315
uint8_t facesType() const
Gets the Faces type.
Definition unit_FacesQWERTY.hpp:169
virtual bool begin() override
Definition unit_FacesQWERTY.cpp:267
uint8_t released() const
Gets the released key character code if updated.
static uint8_t character_to_mode_bits(const char ch)
Character to mode bits.
Definition unit_FacesQWERTY.cpp:248
virtual keyboard::key_index_t toKeyIndex(const char ch) const override
Obtains the key index corresponding to the specified character.
Definition unit_FacesQWERTY.hpp:143
bool readFacesType(uint8_t &ftype)
Read the faces type.
Definition unit_FacesQWERTY.cpp:423
void config(const config_t &cfg)
Set the configuration.
Definition unit_FacesQWERTY.hpp:136
Class supporting keyboard state acquisition by key press bits.
Top level namespace of M5stack.
Settings for begin.
Definition unit_FacesQWERTY.hpp:100
uint32_t holding_threshold
Threshold for key holding (ms)
Definition unit_FacesQWERTY.hpp:114
uint32_t interval
Periodic interval.
Definition unit_FacesQWERTY.hpp:110
uint32_t repeating_threshold
Threshold for key repeating (ms)
Definition unit_FacesQWERTY.hpp:112
bool start_periodic
Start periodic measurement on begin?
Definition unit_FacesQWERTY.hpp:102
keyboard::Mode mode
Definition unit_FacesQWERTY.hpp:108
bool trigger_irq
Triggering an interrupt to update? (interval setting is ignored)
Definition unit_FacesQWERTY.hpp:104
constexpr uint8_t TYPE_QWERTY
SKU:A003.
Definition unit_FacesQWERTY.hpp:25
uint8_t key_index_t
Key index (Not character)
Definition unit_Keyboard.hpp:24
Mode
Operation mode for M5Unit-KEYBOARD firmware.
Definition unit_Keyboard.hpp:50