Open mayur-rajput opened 1 year ago
hi,
please refer to the keyboard parser in M5Stack_Grey_USB_Test, where usbkbd.h
implements a basic qwerty layout, and kbdparser.h
handles the parsing events.
just copy usbkbd.h
and kbdparser.h
files to your sketch folder
you can keep usbkbd.h
unchanged, but you will have to edit kbdparser.h
(e.g. remove all tft.*
statements), and replace the callback function in your sketch:
KbdRptParser Prs;
// keyboard data parser to pass to the USB driver as a callback
static void my_USB_PrintCB(uint8_t usbNum, uint8_t byte_depth, uint8_t* data, uint8_t data_len)
{
Prs.Parse( usbNum, data_len, data );
}
if you feel like such example sketch will be helpful, feel free to submit a pull request :wink:
hello, it would be more helpful if you can add support for usb keyboard to read and serial print the keystroke.