Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411433 Posts in 69363 Topics- by 58418 Members - Latest Member: Pix_RolleR

April 20, 2024, 06:13:44 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)SDL and the 360 Controller
Pages: [1]
Print
Author Topic: SDL and the 360 Controller  (Read 6822 times)
Gravious
Level 2
**


"Swedish meatballs"


View Profile WWW
« on: July 29, 2007, 05:18:41 AM »

I'm trying to find out if SDL can detect and use dual analogue sticks on a 360 controller (or any other controller with dual analogues,) but i cant find specific tutorials or evidence that it can. 

Can anyone help?
Logged

One day I'll think about doing something to stop procrastinating.
ravuya
Level 7
**


Yip yip yip yip yip


View Profile WWW
« Reply #1 on: July 29, 2007, 09:17:49 AM »

Yes, I'm doing it right now.

The second stick just appears as another two axes, along with the analogue triggers.
Logged

PoV
Level 5
*****


Click on the eye and something might happen..maybe


View Profile WWW
« Reply #2 on: August 01, 2007, 09:50:53 PM »

Yeah, it does.  The only annoyance with it is Microsoft's driver combines the L and R triggers in to a single axis (it's not just SDL).  Especially given 3rd party drivers for the original Xbox and GameCube controllers treat them just fine as separate axes.

There's a standard controller tutorial on the SDL site.  Start there.  Axis will read as a value from either -128 to 127, or 0 to 255 (I can't remember).  It's pretty straight forward.
Logged

Mike Kasprzak | Sykhronics Entertainment - Smiles (HD), PuffBOMB, towlr, Ludum Dare - Blog
ravuya
Level 7
**


Yip yip yip yip yip


View Profile WWW
« Reply #3 on: August 02, 2007, 05:42:06 AM »

It actually shows as a signed short, so 32767 and -32767. Or something like that.??But that is just technical pedantry. The single axis triggers annoy me too. Wonder if that's how it is on the 360.
Logged

Ryan
Level 1
*



View Profile
« Reply #4 on: August 02, 2007, 10:34:44 AM »

If you are on windows, go to the control panel, and then go to the controllers thingy. Double click on your 360 controller, and there will be a place where you can test out the different options. This helped me visualize what axes were what and how the buttons were numbered.

If I still had the source I would have put it up, but I didn't bother saving it after a reformat. Using what I just said + the SDL joystick example will make everything straight forward.

If you STILL can't get it after trying these things, let me know.
Logged
PoV
Level 5
*****


Click on the eye and something might happen..maybe


View Profile WWW
« Reply #5 on: August 02, 2007, 01:15:00 PM »

The single axis triggers annoy me too.

Really, I wonder what Microsoft was thinking.  It's quite an annoying restriction, and every non 360 controller I've tested gives L and R their own axis.  Thanks to a silly Microsoft oversight, any game that wants to support the controller correctly is going to need custom code, if you use the triggers.

What's most baffling, is I can't theoretically hold down both triggers to fire dual guns in Halo thanks to this silly implementation.  Sure, on PC you'd use mouse+keyboard, but it extra sucks from a development standpoint.

If only the PS3 controller worked properly.  Not that half ass solution without the extra axis (that I can't get to work on XP64).
Logged

Mike Kasprzak | Sykhronics Entertainment - Smiles (HD), PuffBOMB, towlr, Ludum Dare - Blog
Flink
Level 1
*


Visiontrick


View Profile WWW
« Reply #6 on: October 04, 2007, 02:22:31 AM »

When i used the 360 controller on the pc i use X-Input which is a nice API for using the 360 controller on  a pc, VERY easy to use!
Logged

Ishi
Pixelhead
Level 10
******


coffee&coding


View Profile WWW
« Reply #7 on: October 04, 2007, 11:43:19 AM »

Aye, I have to hand it to Microsoft, XInput is a super sexy API. It also handles the triggers properly so you can press them at the same time (don't ask me how). Also gives you access to the 360 pad's awesome rumble.

It's just a shame you have to do extra code specifically for the 360 pad.
Logged

JP
Level 0
***


vordhosbn brezhoneg


View Profile WWW
« Reply #8 on: October 08, 2007, 08:17:33 PM »

A little thingy I made this weekend uses the 360 wireless controller in Linux (using the xpad driver) so yeah it's much like any other pad albeit with weird axis mappings.
« Last Edit: October 08, 2007, 08:20:14 PM by JP » Logged
Bezzy
Level 5
*****


Loves the Gloves


View Profile WWW
« Reply #9 on: November 02, 2007, 11:19:50 AM »

Aye, I have to hand it to Microsoft, XInput is a super sexy API. It also handles the triggers properly so you can press them at the same time (don't ask me how). Also gives you access to the 360 pad's awesome rumble.

It's just a shame you have to do extra code specifically for the 360 pad.

You also have access to the headphone speaker and microphone with XInput. XInput = TrueWin.
Logged

SplinterOfChaos
Level 3
***



View Profile
« Reply #10 on: December 10, 2007, 06:46:10 PM »

Anyone think that maybe Microsoft was an ass on purpose (again) in order to keep control of their product and keep a feeling of self worth (again) in a world that is run by the Microsoft Monopoly while desperately hunting for refuge in third-party software, that Microsoft then tries to control (again)?

I'm honestly not sure, but is seems like something they'd do to me.
Logged

Alex May
...is probably drunk right now.
Level 10
*


hen hao wan


View Profile WWW
« Reply #11 on: December 11, 2007, 04:17:32 AM »

Hm?
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic