ricardoquesada / bluepad32

Bluetooth gamepad, mouse and keyboard support for ESP32 and PicoW
https://bluepad32.readthedocs.io/
Other
612 stars 64 forks source link

wii: support native WiiMote button mapping #98

Closed mdvorak closed 7 months ago

mdvorak commented 7 months ago

When library is used as controller host, and not translation layer for consoles, it is impossible to use WiiMote in predefined configuration. Additionally, buttons from Nunchuck are merged with WiiMote buttons, without ability to read them separately.

This PR adds public wii_force_flags function, which can be called during init. It forces wii controller to enter desired mode, regardless of buttons pressed during pairing. Additionally, it adds WII_FLAGS_NATIVE mode, which maps all buttons to the closest possible value. Additional remapping can be done via standard API.

While I understand wii_force_flags is not ideal solution, WiiMote is already very specific in many ways, and if you want to support it, this gives you easy way to do so. This does not affect other controllers at all.

mdvorak commented 7 months ago

I see you have main and develop branches, should I reopen this PR to develop branch instead?