Closed mdvorak closed 2 months ago
yes, I've been thinking about improving the Wii code.
I don't like that everything is hardcoded the way it is... the driver should provide primitives, and the clients should put Wii in the desired mode.
In any case, let's merge this pull-request... but I'll make some changes to in the coming days/weeks.
@mdvorak great add. Are you aware that the Wiimote functions different in horizontal mode than in vertical position? I have seen some github issues over the years that users request this.
a did a follow-up fix.
basically I merged "native" with "vertical". Removed the old behavior, the "native" is the current one. with some minor changes
https://github.com/ricardoquesada/bluepad32/commit/c810b8eb45a355299d35850a9445dd4ffa1a39be
Thats fantastic, thanks!
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.
Replaces #98