SDL_Controller design

Ed Phillips <[email protected]>
Newsgroups gmane.comp.lib.sdl
Message-ID <[email protected]>
Hello,

I think I'm missing something when it comes to the basic reasoning behind 
the design of the SDL_Controller stuff, and the documentation on the Wiki 
that I can see doesn't go into any discussion on the design decisions.

When I first looked at the "mapping" capabilities of SDL_Controller, I 
thought, HEY!, this was a way to give names to each of the buttons/axes on 
any device, so you can pass them through to the application/game and it 
can present these names to the user when they are setting up their 
controller configuration.  Cool!  Oh look, they already have a database of 
these name mappings!  Great!

However, the more I started looking at it, I began to see that this is not 
the case at all.  It seems to be a way to turn the raw button/axis numbers 
on a non-XInput device into an XInput control like "leftshoulder" or 
"righty"?

So really, this is just a way to make every controller work like an XBox 
controller (even if it doesn't have the same physical controls or the same 
names on the buttons, etc.), and doesn't really address the issue of 
mapping the names of the actual physical controls on a particular device 
to the button/axis numbers normally received in SDL_Joystick calls?

I guess if you don't want your game/application to treat every device like 
an XBox 360 Controller, then the SDL_Controller stuff is not for you?

How does Steam's controller API play into things?  There is mention of 
Steam here (and nowhere else I can find):

http://wiki.libsdl.org/CategoryGameController

It states:

"If you are running your game from Steam, the game controller mapping is 
automatically provided for your game."

I'm not sure what that means.  Steam controller mappings take a list of 
"actions" defined for a game, and allow the developer and/or user to 
configure which controls on their devices will invoke these actions.  A 
game using the controller API will see "actions" and not raw inputs... so 
I'm not sure how the SDL_Controller stuff plays into this.  Also, in order 
to use the Steam controller API, you have to call functions in the Steam 
runtime, and I'm not sure if SDL can/would be doing that, and it won't 
provide an SDL_Controller mapping.

Any help regarding these concepts would be greatly appreciated!

Thanks,

 	Ed

Ed Phillips <[email protected]> University of Delaware (302) 831-6082
Systems Programmer IV, Network and Systems Services
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.