Controller mappings for PS3 (official and generic). #2159

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants

Also added XNA-style ToString() overrides to a few of the GamePad subordinates to aid in debugging.

Only tested on OS X, using official PS3 controller, and a GameStop knock-off PS3 controller.

Issue: mono#2154

Rationale: Using PS3 controllers in OS X is a breeze compared to the 360 -- especially in Mavericks, where the tattiebogle drivers don't seem to work any more. Nothing to install, just plug the PS3 controller into the USB port. (Even the wireless works with a mini USB cord.)

groundh0g added some commits Dec 9, 2013

groundh0g Controller mappings for PS3 (official and generic). Also added XNA-st…
…yle ToString overrides to aid in debugging.
079d1b3
groundh0g Fixing XS' auto-formatting of previously-existing #if directives to c…
…onform to MG development standards.
b380d55
Member

mgbot commented Dec 9, 2013

Can one of the admins verify this patch?

Member

mgbot commented Dec 9, 2013

Can one of the admins verify this patch?

Note that I would much rather put this (possibly ever-growing) list of mappings into an external file (.dll.config or .xml), but wasn't sure how you guys felt about external dependencies.

Could be one of those things where if the file is missing (or can't be accessed on certain platforms), then the default 360 mappings take over -- then they would be the only mappings that actually live in code.

Controller names could be matched on substring (as I've done) or regex. Since we're not initializing often (currently at startup, but I would imagine you'll support hot swapping in the future), regex would be more flexible.

Contributor

flibitijibibo commented Dec 10, 2013

You might want to look at the SDL2_GamePad, for both the SDL_GameController autoconfig and the MonoGameJoystick.cfg manual fallback:

https://github.com/flibitijibibo/MonoGame/blob/monogame-sdl2/MonoGame.Framework/SDL2/Input/SDL2_GamePad.cs

This is pretty close to what you're looking for, I think. It just requires SDL2 over SDL 1.2, and has a small attachment to SDL2_GameWindow for hotplugging support.

Made move to OpenTK. Killing this PR and creating a new one.

groundh0g closed this Oct 25, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment