The RetroConnector is an amazing open-source project by ‘Option 8’. Contained within the project is Arduino code for connecting a USB Game HID wired game controller.
https://github.com/option8/RetroConnector/tree/master/Joystick%20Interface
Recently code has been created to make use of wireless Bluetooth and allowing a Bluetooth gaming controller. The code has been loaded into the RetroConnector as ‘firmware’ on the ATMEGA328 chip.
Depending on which new firmware you have loaded into the RetroConnector, it can support PS4 type controllers OR Xbox type controllers, including some of the 8BitDo model controllers with Xbox support. The different controllers offer different ‘personalities’ described in this manual.
The Keyboard-XXX Libraries are for the Keyboard connector https://github.com/option8/RetroConnector/tree/master/Keyboard%20Interface%20IIe