KeyboardAdapter
-
class KeyboardAdapter : public InputInterface
- #include <KeyboardAdapter.h>
Input interface to keyboard. Uses default buttons layout:
ArrowsforLEFT/RIGHT/UP/DOWN;EnterforENTER;EscapeforBACK;DeleteforCLEAR;BackspaceforBACKSPACE;
Keyboard can send multiple-bytes commands. Implementation should convert it to one byte command.
Implementation details.
Mapping:
First 128 of ASCII-> as is\r->ENTER\n->ENTER\r\n->ENTERESC->BACKESC [ A(up arrow) ->UPESC [ B(down arrow) ->DOWNESC [ C(right arrow) ->RIGHTESC [ D(left arrow) ->LEFTESC [ 3 ~(Delete button) ->CLEAR
Public Functions
-
inline KeyboardAdapter(LcdMenu *menu, Stream *stream)
Private Types
Private Functions
Private Members
-
CodeSet codeSet = CodeSet::C0
Internal state of current code set. As stream receives bytes asynchronously, multiple bytes command can arrive in several calls. Need to store current state between calls.
-
unsigned long lastCharTimestamp
Milliseconds timestamp of last received character. Used for detecting ESC with no chars next or single
\rwithout\n.