34 #include "freertos/FreeRTOS.h" 71 struct DeadKeyVirtualKeyDef {
108 struct SupportedLayouts {
109 static int count() {
return 5; }
110 static char const * * names() {
111 static char const * NAMES[] = {
116 SpanishLayout.
desc };
119 static char const * * shortNames() {
120 static char const * SNAMES[] = {
125 SpanishLayout.
name };
128 static const KeyboardLayout * * layouts() {
129 static KeyboardLayout
const * LAYOUTS[] = {
194 void begin(gpio_num_t clkGPIO, gpio_num_t dataGPIO,
bool generateVirtualKeys =
true,
bool createVKQueue =
true);
215 void begin(
bool generateVirtualKeys,
bool createVKQueue,
int PS2Port);
352 int getNextScancode(
int timeOutMS = -1,
bool requestResendOnTimeOut =
false);
375 bool setLEDs(
bool numLock,
bool capsLock,
bool scrollLock) {
return send_cmdLEDs(numLock, capsLock, scrollLock); }
386 void getLEDs(
bool * numLock,
bool * capsLock,
bool * scrollLock);
398 bool setTypematicRateAndDelay(
int repeatRateMS,
int repeatDelayMS) {
return send_cmdTypematicRateAndDelay(repeatRateMS, repeatDelayMS); }
400 #if FABGLIB_HAS_VirtualKeyO_STRING 401 static char const * virtualKeyToString(
VirtualKey virtualKey);
435 VirtualKey blockingGetVirtualKey(
bool * keyDown);
436 static void SCodeToVKConverterTask(
void * pvParameters);
439 bool m_keyboardAvailable;
442 TaskHandle_t m_SCodeToVKConverterTask;
443 QueueHandle_t m_virtualKeyQueue;
445 uint8_t m_VKMap[(int)(VK_LAST + 7) / 8];
463 bool m_scrollLockLED;
void injectVirtualKey(VirtualKey virtualKey, bool keyDown, bool insert=false)
Adds or inserts a virtual key into the virtual keys queue.
All in one structure to fully represent a keyboard layout.
bool isKeyboardAvailable()
Checks if keyboard has been detected and correctly initialized.
Represents the whole application base class.
DeadKeyVirtualKeyDef deadkeysToVK[64]
This file contains all classes related to FabGL Graphical User Interface.
VirtualKeyDef exScancodeToVK[32]
int virtualKeyToASCII(VirtualKey virtualKey)
Converts virtual key to ASCII.
void setUIApp(uiApp *app)
Sets current UI app.
void emptyVirtualKeyQueue()
Empties the virtual keys queue.
Delegate< VirtualKey *, bool > onVirtualKey
Delegate called whenever a new virtual key is decoded from scancodes.
AltVirtualKeyDef alternateVK[64]
void getLEDs(bool *numLock, bool *capsLock, bool *scrollLock)
Gets keyboard LEDs status.
bool isVKDown(VirtualKey virtualKey)
Gets the virtual keys status.
The PS2 Keyboard controller class.
VirtualKeyDef scancodeToVK[92]
VirtualKey
Represents each possible real or derived (SHIFT + real) key.
bool setLEDs(bool numLock, bool capsLock, bool scrollLock)
Sets keyboard LEDs status.
void begin(gpio_num_t clkGPIO, gpio_num_t dataGPIO, bool generateVirtualKeys=true, bool createVKQueue=true)
Initializes Keyboard specifying CLOCK and DATA GPIOs.
VirtualKey getNextVirtualKey(bool *keyDown=nullptr, int timeOutMS=-1)
Gets a virtual key from the queue.
int virtualKeyAvailable()
Gets the number of virtual keys available in the queue.
Base class for PS2 devices (like mouse or keyboard).
Associates scancode to virtualkey.
This file contains FabGL library configuration settings, like number of supported colors...
bool reset()
Sends a Reset command to the keyboard.
Associates a virtualkey and various shift states (ctrl, alt, etc..) to another virtualkey.
int getNextScancode(int timeOutMS=-1, bool requestResendOnTimeOut=false)
Gets a scancode from the queue.
int scancodeAvailable()
Gets the number of scancodes available in the queue.
static int scancodeToVirtualKeyTaskStackSize
Stack size of the task that converts scancodes to Virtual Keys Keyboard.
bool setTypematicRateAndDelay(int repeatRateMS, int repeatDelayMS)
Sets typematic rate and delay.
void setLayout(KeyboardLayout const *layout)
Sets keyboard layout.
KeyboardLayout const * inherited
void suspendVirtualKeyGeneration(bool value)
Suspends or resume the virtual key generation task.
KeyboardLayout const * getLayout()
Gets current keyboard layout.
This file contains fabgl::PS2Device definition.