FabGL
ESP32 VGA Controller and Graphics Library

◆ getNextScancode()

int fabgl::KeyboardClass::getNextScancode ( int  timeOutMS = -1,
bool  requestResendOnTimeOut = false 
)

Get a scancode from the queue.

Scancodes are always generated but they can be consumed by the scancode-to-virtualkeys task. So, in order to use this method KeyboardClass.begin() method should be called with generateVirtualKeys = false and createVKQueue = false. Alternatively it is also possible to suspend the conversion task calling KeyboardClass.suspendVirtualKeyGeneration() method.

Parameters
timeOutMSTimeout in milliseconds. -1 means no timeout (infinite time).
requestResendOnTimeOutIf true and timeout has expired then asks the keyboard to resend the scancode.
Returns
The first scancode of the queue (-1 if no data is available in the timeout period).