FabGL
ESP32 VGA Controller and Graphics Library
|
void fabgl::KeyboardClass::begin | ( | gpio_num_t | clkGPIO, |
gpio_num_t | dataGPIO, | ||
bool | generateVirtualKeys = true , |
||
bool | createVKQueue = true |
||
) |
Initialize KeyboardClass specifying CLOCK and DATA GPIOs.
A reset command (KeyboardClass.reset() method) is automatically sent to the keyboard. This method also initializes the PS2ControllerClass, calling its begin() method.
clkGPIO | The GPIO number of Clock line |
dataGPIO | The GPIO number of Data line |
generateVirtualKeys | If true creates a task which consumes scancodes and produces virtual keys, so you can call KeyboardClass.isVKDown(). |
createVKQueue | If true creates a task which consunes scancodes and produces virtual keys and put them in a queue, so you can call KeyboardClass.isVKDown(), KeyboardClass.scancodeAvailable() and KeyboardClass.getNextScancode(). |
Example:
// Setup pins GPIO33 for CLK and GPIO32 for DATA Keyboard.begin(GPIO_NUM_33, GPIO_NUM_32); // clk, dat