|
VT100 Terminal App
Circle VT100 module documentation
|
Cooperative task managing keyboard devices and event translation. More...
#include <TKeyboard.h>
Public Types | |
| using | TKeyPressedHandler = void(*)(const char *pString) |
| using | TKeyStatusHandlerRaw = void(*)(unsigned char ucModifiers, const unsigned char RawKeys[6]) |
Public Member Functions | |
| CTKeyboard (void) | |
| Construct the singleton keyboard task; dependencies are hooked via Configure(). | |
| void | Configure (TKeyPressedHandler pKeyPressedHandler, TKeyStatusHandlerRaw pKeyStatusHandlerRaw=nullptr, CUSBHCIDevice *pUSBHost=nullptr, unsigned keyRepeatDelayMs=KeyRepeatDelayDefaultMs, unsigned keyRepeatRateCps=KeyRepeatRateDefaultCps) |
| Configure callbacks and optional host controller. | |
| ~CTKeyboard (void) | |
| Cleanup the keyboard task on shutdown. | |
| boolean | Initialize (void) |
| Initialize keyboard devices and start the task. | |
| boolean | UpdateKeyboard (boolean bDevicesUpdated) |
| Check for and handle keyboard plug and play events. | |
| void | UpdateLEDs (void) |
| Update keyboard LED state (must be called from main loop). | |
| boolean | IsKeyboardConnected (void) const |
| Check if keyboard is connected. | |
| void | OnConfigUpdated () |
| Notify keyboard that configuration changed. | |
| void | Update () |
| Periodic update hook called from the scheduler loop. | |
| void | Run (void) override |
| Entry point of the keyboard task. | |
| void | SetKeyPressedHandler (TKeyPressedHandler handler) |
| Replace the key pressed handler. | |
| void | SetKeyStatusHandlerRaw (TKeyStatusHandlerRaw handler) |
| Replace the raw key status handler. | |
| TKeyPressedHandler | GetKeyPressedHandler () const |
| Get current key pressed handler. | |
| TKeyStatusHandlerRaw | GetKeyStatusHandlerRaw () const |
| Get current raw key status handler. | |
Static Public Member Functions | |
| static CTKeyboard * | Get (void) |
| Access the singleton keyboard task instance. | |
Cooperative task managing keyboard devices and event translation.
The keyboard task detects hot-plug events, surfaces processed key strings via callbacks, and maintains raw status notifications for consumers that need modifier state. It also implements configurable auto-repeat and LED updates to emulate the VT100 hardware experience.
| void CTKeyboard::Configure | ( | TKeyPressedHandler | pKeyPressedHandler, |
| TKeyStatusHandlerRaw | pKeyStatusHandlerRaw = nullptr, |
||
| CUSBHCIDevice * | pUSBHost = nullptr, |
||
| unsigned | keyRepeatDelayMs = KeyRepeatDelayDefaultMs, |
||
| unsigned | keyRepeatRateCps = KeyRepeatRateDefaultCps |
||
| ) |
Configure callbacks and optional host controller.
| pKeyPressedHandler | Callback invoked for processed key strings. |
| pKeyStatusHandlerRaw | Optional callback receiving raw key status updates. |
| pUSBHost | Optional USB host controller used for plug-and-play updates. |
| keyRepeatDelayMs | Auto-repeat activation delay in milliseconds. |
| keyRepeatRateCps | Auto-repeat rate in characters per second. |
| boolean CTKeyboard::Initialize | ( | void | ) |
Initialize keyboard devices and start the task.
| boolean CTKeyboard::IsKeyboardConnected | ( | void | ) | const |
Check if keyboard is connected.
| bool CTKeyboard::UpdateKeyboard | ( | boolean | bDevicesUpdated | ) |
Check for and handle keyboard plug and play events.
| bDevicesUpdated | TRUE if USB devices were updated. |