NicoHood / Nintendo

Use Nintendo Controllers with Arduino
http://www.nicohood.de
MIT License
278 stars 55 forks source link

Added support for GameCube keyboard controller. #50

Closed bkacjios closed 2 years ago

bkacjios commented 2 years ago

Figured I'd send a pull request for this. Allows you to read the keypresses of an ASCII gamecube keyboard controller.

Here's an example sketch converting the input to a USB keyboard. https://github.com/bkacjios/Arduino-GameCube-Keyboard-Controller/blob/main/Arduino-GameCube-Keyboard-Controller.ino

NicoHood commented 2 years ago

Very nice PR! I was wondering if it makes sense to integrate this all into the whole gamecube controller class or if we should create different instances for that. I have no opinion on that yet.

Looking at the wheel support PR, there I did not add this code at all, as I could not test it. But this wheel should be added the same way, so we should think of a clever solution. Maybe yours is that already, I don't know. Your thoughts? https://github.com/NicoHood/Nintendo/pull/43/files

bkacjios commented 2 years ago

I kind of like everything being in a single class, mainly because my adapter I created has two ports and can be hot-swapped on the fly between a regular controller or a keyboard. I can just handle whatever device gets detected using GamecubeController::getDevice.

NicoHood commented 2 years ago

Very nice!

Thanks for the contribution :)