tag:blogger.com,1999:blog-3064325214589649535.post4093281045482168422..comments2024-03-28T06:52:15.545+01:00Comments on Joost's Dev Blog: The craziness that is joysticks on PCJoost van Dongenhttp://www.blogger.com/profile/00569566310604620045noreply@blogger.comBlogger17125tag:blogger.com,1999:blog-3064325214589649535.post-28127282397807565242016-12-23T03:07:32.732+01:002016-12-23T03:07:32.732+01:00Yes, SDL2 supports both triggers and rumble on the...Yes, SDL2 supports both triggers and rumble on the XBox 360 controller. The hope is that most of the craziness that you had to deal with is wrapped up nicely now.<br /><br />Steam Big Picture does have UI support to map almost any kind of joystick into the SDL game controller API, and saves out a config mapping string. It's roughly equivalent to the controllermap program here:<br />https://hg.libsdl.org/SDL/file/default/test/controllermap.c<br /><br />Steam's Steam controller configuration support is separate from SDL's game controller API, and currently only supports Steam controllers and PS4 controllers, but support for any SDL game controller is coming soon.sloukenhttps://www.blogger.com/profile/10886323786300442726noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-47050783126804861042016-10-26T14:49:24.952+02:002016-10-26T14:49:24.952+02:00(I'm not sure how these things work on OSX and...(I'm not sure how these things work on OSX and Windows, but I think on Windows SDL2 supports both XInput and DirectInput, so the xbox360 controller should properly there as well. No idea what Steam on Windows or OSX supports in Big Picture, but I guess they support all kinds of joystick-like devices there as well)Danielhttps://www.blogger.com/profile/00508018378115314618noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-50827519464796779742016-10-26T14:45:47.894+02:002016-10-26T14:45:47.894+02:00Yep, the triggers are handled as axes that give yo...Yep, the triggers are handled as axes that give you a value between 0 and 32767 (while normal axes from analog sticks use -32768 to 32767).<br />Rumble also works, see https://wiki.libsdl.org/CategoryForceFeedback<br /><br />I think Steam supports configuring (and using) all controllers Linux recognizes as joysticks - I tried an old PS2 controller with a cheap USB adapter. More common controllers probably work without configuration, the xbox360 controller certainly does.Danielhttps://www.blogger.com/profile/00508018378115314618noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-84522992243779314262016-10-26T10:24:34.347+02:002016-10-26T10:24:34.347+02:00Thanks for the update! :) Does SDL2 support both t...Thanks for the update! :) Does SDL2 support both triggers and rumble on the Xbox360 controller?<br /><br />I heard that Steam's controller support currently only does PS4controller and SteamController, others hopefully coming later. Is that what you are referring to?Joost van Dongenhttps://www.blogger.com/profile/00569566310604620045noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-43285354505402331042016-10-26T04:04:41.054+02:002016-10-26T04:04:41.054+02:00I know this post is >4 years old, but an update...I know this post is >4 years old, but an update on SDL: SDL2 is pretty awesome when it comes to joysticks and controllers.<br />You get connect/disconnect events now (finally!).<br /><br />But what's really cool: it has a "GameController" API that abstracts xbox/playstation like controllers. It gives you consistent axis and button numbering for all supported devices.<br />And even if a device is unsupported, one can create a mapping to support it afterwards. At least on Linux, Steam lets you do the corresponding configuration in the Big Picture settings and that mapping should then be used by SDL2 games started from Steam.<br />On other platforms you could still provide mappings via textfile (https://github.com/gabomdq/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt collects them) or environment variable.<br /><br />And of course the SDL APIs to handle things are much nicer and easier to use than the platform specific things (XInput, DirectInput, /dev/input/js*, ..)Danielhttps://www.blogger.com/profile/00508018378115314618noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-52514380727878617502016-04-23T09:23:36.948+02:002016-04-23T09:23:36.948+02:00Fantastic post I have been working on an open sour...Fantastic post I have been working on an open source joystick lib and have run in to many of the same things.Alan Uthoffnoreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-33977785791997108302014-12-24T05:52:09.719+01:002014-12-24T05:52:09.719+01:00Don't use MotioninJoy, its a virus.
Use SCP d...Don't use MotioninJoy, its a virus.<br /><br />Use SCP driver package insteadLAK132https://www.blogger.com/profile/12440848471795312359noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-5371879214208738612014-12-24T05:51:35.209+01:002014-12-24T05:51:35.209+01:00xbox controllers use both HID and xinput to commun...xbox controllers use both HID and xinput to communicate with the PC. Games that ONLY support the XBox controller typically use xinput side of things, however if your game supports HID (which is part of the OS) it WILL support the XBox controller and any other HID controllerLAK132https://www.blogger.com/profile/12440848471795312359noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-13292210072334521742013-11-02T21:54:52.374+01:002013-11-02T21:54:52.374+01:00Because XBox Controller it's very popular and ...Because XBox Controller it's very popular and uses a total diferent API from the other ones.<br />Also, there is a small program that lets you emulate a XBox 360 controller with a legacy controller, many games plays a lot better using that utility than using the game support for legacy controllers.<br />The utility is called x360ce , if you have a legacy controller I highly recommend you to use that utility, you will be able to play the games that uses only XBox Controller, you will have no problems if a game is not properly configured with your controller and also, you will save time because you will not need to open the button configuration.Lobishomenhttps://www.blogger.com/profile/00550783270389021708noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-2529932095059735722012-08-17T12:48:06.332+02:002012-08-17T12:48:06.332+02:00Indeed, we have a control configuration menu, but ...Indeed, we have a control configuration menu, but you still need to take into account most of the things mentioned in the post. And the control configuration menu itself is also quite a lot of work by itself.Joost van Dongenhttps://www.blogger.com/profile/00569566310604620045noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-55881088144658537822012-08-17T12:31:04.344+02:002012-08-17T12:31:04.344+02:00Instead of trying to support every single existing...Instead of trying to support every single existing controller (I personally think that's too much hassle if not impossible, as there may be controllers you are not aware of out there)<br />a better and safer approach would be to just let the player properly map the buttons before playing, so they can choose the layout they like. <br /><br />Only the most popular controllers, like the 360 one, would be supported out of the box._yoshi_https://www.blogger.com/profile/00967481168135808549noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-6277857860140438922012-08-16T11:29:00.555+02:002012-08-16T11:29:00.555+02:00Maybe at some point in the future, but we are also...Maybe at some point in the future, but we are also considering to license out our engine at some point, in which case it would be better to not share too much of the actual implementations online...Joost van Dongenhttps://www.blogger.com/profile/00569566310604620045noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-84469890158144458062012-08-16T11:02:42.097+02:002012-08-16T11:02:42.097+02:00I've noticed the same things whilst trying to ...I've noticed the same things whilst trying to support joypads properly! Extremely annoying for something that should be relatively simple.<br /><br />Do you have any plans to share any of your input code? This is something a lot of developers will be either implementing independently, or as you say, just not doing properly :)Ben Hymershttps://www.blogger.com/profile/02845256443311896114noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-61127164091717404252012-08-12T21:41:21.396+02:002012-08-12T21:41:21.396+02:00Because many people have something else and we wan...Because many people have something else and we wanted to do this right. :)Joost van Dongenhttps://www.blogger.com/profile/00569566310604620045noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-19263377545938945752012-08-12T02:57:04.382+02:002012-08-12T02:57:04.382+02:00I've been using a PS3 controller and a MotionJ...I've been using a PS3 controller and a MotionJoy driver to play Awesomenauts. It's been working out great! I love it when devs add in controller support.I love you devsnoreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-66824155948794696512012-08-11T19:41:30.278+02:002012-08-11T19:41:30.278+02:00Because they're Awesome, and this is Awesomena...Because they're Awesome, and this is Awesomenauts!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-71026496506209872582012-08-11T18:35:14.129+02:002012-08-11T18:35:14.129+02:00Very nice and informative post!
Many devs choose ...Very nice and informative post!<br /><br />Many devs choose to support only the official Xbox controller... Why did you go this far?Ciro Continisiohttps://www.blogger.com/profile/12356260874851669502noreply@blogger.com