Re: SDL_Controller design

Ed Phillips <[email protected]> Mon, 19 Dec 2016 12:18:07 -0500 (EST)
Newsgroups gmane.comp.lib.sdl
Message-ID <[email protected]>
Hi Alex,

On Thu, 1 Dec 2016, Alex Szpakowski wrote:

> The SDL_GameController API is so your code can determine that e.g. the 
> left trigger on a controller is held down, no matter what 
> controller-like device is used and no matter what OS or drivers are used

This kind of plain talk should be in the Wiki. :-)

> (for example the button and axis indices reported by the Xbox 360 
> controller on Windows are different than those reported when using the 
> Tattiebogle driver for the 360 on macOS).

Yeah, isn't it funny how even the button numbers don't match for the same 
device between OSes?

> The latest SDL source code has an API in SDL_Joystick to get the vendor 
> and product IDs of a joystick. That’s what you’d want to use if you want 
> to display different button prompts (images and text) depending on what 
> controller is actually used.

The GUID has these IDs embedded too?  Unfortunately, the XINPUT "GUID" 
trick kinda thwarts that for a lot of devices... :-(

There needs to be a way to tell the "type" of device, but also which 
plugged-in-device is which (existing "XInput Controller #2" scheme vs. 
something identifiable to the user like "Logitech F310 Gamepad in XINPUT 
mode").

Thanks,

 	Ed

Ed Phillips <[email protected]> University of Delaware (302) 831-6082
Systems Programmer IV, Network and Systems Services

_______________________________________________
SDL mailing list
[email protected]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org