ESP32 USB Keyboard Test Example
I tested on basic USB 2.0 port Keyboards only with PS2 backward support. (nothing guaranteed) I used Arduino Library PS2KeyAdvanced-library.zip (thanx to author)
...or for ESP32 USB 1.1 low speed soft host mode try: https://github.com/nathalis/ESP32-USB-SOFTHOST1.1-LOWSPEED-KEYBOARD-AND-MOUSE