6 #ifndef _KEYBOARD_MANGER_H_
7 #define _KEYBOARD_MANGER_H_
47 const char *pgmLayout;
60 this->pgmLayout = pgmLayout;
61 this->pins =
new uint8_t[rows + cols];
68 int numColumns() {
return cols; }
70 int numRows() {
return rows; }
72 void setColPin(
int col,
int pin) {
73 if(col < cols) pins[rows + col] = pin;
76 void setRowPin(
int row,
int pin) {
77 if(row < rows) pins[row] = pin;
80 int getRowPin(
int row) {
84 int getColPin(
int col) {
85 return pins[rows + col];
88 char keyFor(uint8_t row, uint8_t col) {
89 if(row < rows && col < cols)
return pgm_read_byte_near(&pgmLayout[(row * cols)+col]);
106 #define KEYBOARD_TASK_MILLIS 50
124 uint8_t repeatTicks = 10;
125 uint8_t repeatStartTicks = 30;
133 void setRepeatKeyMillis(
int startAfterMillis,
int repeatMillis);
135 uint32_t timeOfNextCheck()
override;
136 void exec()
override;
138 friend void rawKeyboardInterrupt();
140 void setToOutput(
int i);
141 void enableAllOutputsForInterrupt();
143 void doDebounce(
char time);
146 #define MAKE_KEYBOARD_LAYOUT_3X4(varName) const char KEYBOARD_STD_3X4_KEYS[] PROGMEM = "123456789*0#"; KeyboardLayout varName(4, 3, KEYBOARD_STD_3X4_KEYS);
147 #define MAKE_KEYBOARD_LAYOUT_4X4(varName) const char KEYBOARD_STD_4X4_KEYS[] PROGMEM = "123A456B789C*0#D"; KeyboardLayout varName(4, 4, KEYBOARD_STD_4X4_KEYS);
Using basic IoFacilities allows one to abstract away the use of IoExpanders, such that the switching ...
KeyMode
Definition: KeyboardManager.h:97
Definition: BasicIoAbstraction.h:38
Definition: KeyboardManager.h:43
KeyboardLayout(uint8_t rows, uint8_t cols, const char *pgmLayout)
Definition: KeyboardManager.h:57
Definition: KeyboardManager.h:20
virtual void keyReleased(char key)=0
virtual void keyPressed(char key, bool held)=0
Definition: KeyboardManager.h:118