<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Getting 360 Controller Support Into an A5 Game</title>
		<link>http://www.allegro.cc/forums/view/611465</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 20 Nov 2012 05:31:43 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Basically, I&#39;m just wondering what recommendations everyone has for going about adding X-Box 360 controller support into my game; if there&#39;s any tutorials I should look into or if there&#39;s any existing libraries that would make the process go much more smoothly than trying to code it myself.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kris Asick)</author>
		<pubDate>Mon, 19 Nov 2012 15:03:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Have you got a controller? Just plug it in and try it with ex_joystick_events and ex_joystick_hotplugging.  It&#39;s really straight forward.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Mon, 19 Nov 2012 15:09:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I don&#39;t have a controller yet but can borrow one when I&#39;m ready to make this work, but I thought you had to use Xinput to access 360 controllers and that they didn&#39;t show up over the DirectInput interface?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kris Asick)</author>
		<pubDate>Mon, 19 Nov 2012 15:16:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>My (Logitech F510) controller has an X/D switch on the back, and it works fine with Allegro in both modes.</p><p>EDIT: The axes and buttons don&#39;t work the same in both modes, different order, etc.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Mon, 19 Nov 2012 15:23:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>*is reading up on some Xinput stuff*</p><p>Well, from what I&#39;ve read so far, 360 controllers do indeed show up in DirectInput, but there&#39;s a big problem, at least for the type of game I&#39;m making: On 360 controllers under DirectInput, the triggers, being analog, function as a single axis, where one trigger reports full negative when not held and the other reports full positive, resulting in a return value of 0 for the trigger axis. You could detect pushing one trigger or the other, but not both at the same time because this would ALSO result in a 0 return value.</p><p>To read each trigger independetly requires the use of the Xinput interface, and since I&#39;m making a twin-stick game, this is pretty much a necessity.</p><p>So... yeah. Any recommendations for tutorials or libraries to utilize?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kris Asick)</author>
		<pubDate>Mon, 19 Nov 2012 15:46:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>My original 360 controller has both triggers show up as independent axes. I&#39;m in Linux though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Mon, 19 Nov 2012 15:57:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, the good news is that, from what I&#39;ve read so far, Xinput only has like, 8 functions, 2 of which are audio related, so there&#39;s not much to learn. As is typical with Windows stuff, return values tend to be structures containing all the return data.</p><p>Heck, I might even be able to pull this off without a tutorial, just wing it with the MSDN reference materials in hand. Just have to see about borrowing that controller now. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kris Asick)</author>
		<pubDate>Mon, 19 Nov 2012 16:04:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>After you&#39;ve that, put in some Kinect support <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Mon, 19 Nov 2012 17:29:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>...does anyone even <i>own</i> one of those? <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kris Asick)</author>
		<pubDate>Mon, 19 Nov 2012 18:33:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s useless for games, but I&#39;d say quite nice if you want to do motion capture.</p><p>Anyway, all we need for it is basic video recording support - whether that comes from a webcam or from the kinect wouldn&#39;t matter much.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Mon, 19 Nov 2012 20:28:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I remember wanting to submit a patch so that Allegro 5 could support Xinput behind the scenes. Actually, if I had followed through with my plans, support would of been in there since 5.0.0! The thread I made we were still on 4.9</p><p>It sucks not having free time.</p><p>Anyway, useful docs in case someone wants to make that patch at some point: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ee417014%28v=vs.85%29.aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/ee417014%28v=vs.85%29.aspx</a></p><p><a href="http://www.allegro.cc/forums/thread/604387">Relevant thread</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (MiquelFire)</author>
		<pubDate>Mon, 19 Nov 2012 21:14:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/611465/970532#target">Kris Asick</a> said:</div><div class="quote"><p> On 360 controllers under DirectInput, the triggers, being analog, function as a single axis, where one trigger reports full negative when not held and the other reports full positive, resulting in a return value of 0 for the trigger axis.</p></div></div><p>Yeah, that&#39;s what I get when I try it.  And in DirectInput mode the triggers are just seen as digital buttons, which is even worse.  When testing with XInput mode in x360ce the triggers both go from 0 to 255, as expected.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (torhu)</author>
		<pubDate>Tue, 20 Nov 2012 05:31:43 +0000</pubDate>
	</item>
</rss>
