SFML community forums

Help => System => Topic started by: Jabberwocky on May 07, 2015, 06:57:53 am

Title: Single or separate axis for Xbox controller
Post by: Jabberwocky on May 07, 2015, 06:57:53 am
Does anyone know if SFML treats the xbox controller triggers as a single axis, or two separate axes?
Title: Re: Single or separate axis for Xbox controller
Post by: eXpl0it3r on May 07, 2015, 09:59:53 am
I've split this topic. Next time please don't necro a 5 year old thread to ask a completely unrelated question!
Title: Re: Single or separate axis for Xbox controller
Post by: Jabberwocky on May 07, 2015, 03:31:47 pm
I've split this topic. Next time please don't necro a 5 year old thread to ask a completely unrelated question!

Weird, I thought I posted it in this recent and related thread:  http://en.sfml-dev.org/forums/index.php?topic=17898.0
Apologies, I'm not sure what went wrong, or what thread I necro'd.
Title: Re: Single or separate axis for Xbox controller
Post by: eXpl0it3r on May 07, 2015, 03:53:56 pm
Oh right, sorry I was confused myself.

Regardless, it's an unrelated question, so you should create your own thread instead of hijacking someone else's.
Title: Re: Single or separate axis for Xbox controller
Post by: Jabberwocky on May 07, 2015, 04:21:19 pm
Your definition of "hijack" and "unrelated" must be slightly different than mine.  ;)

Title: Re: Single or separate axis for Xbox controller
Post by: G. on May 07, 2015, 04:46:34 pm
Single axis (Z) in 2.2 and older.  :( :( :(
Title: Re: Single or separate axis for Xbox controller
Post by: Jabberwocky on May 07, 2015, 05:05:29 pm
Single axis (Z) in 2.2 and older.  :( :( :(

That does suck.

That means you can't use the triggers as buttons, as many games like to.  For example, a game in which left trigger is "aim" and right trigger is "fire".  The problem is because if both triggers are pressed at once, they cancel each other out, and report a 0 (neutral) axis value, the same as if neither are pressed.

I was worried that might be the case.  I once read that you need to use XInput to properly detect each trigger separately, although I can't verify that for certain.
Title: AW: Single or separate axis for Xbox controller
Post by: eXpl0it3r on May 07, 2015, 05:23:24 pm
You might want to try SFML 2.3, the joystick code got quite a bit of change.
Title: Re: Single or separate axis for Xbox controller
Post by: Jabberwocky on May 07, 2015, 05:41:07 pm
Cool, thanks eXpl0it3r.
I'll give that a shot when I pick up an x-box controller (busted my old one).
Title: Re: Single or separate axis for Xbox controller
Post by: Laurent on May 07, 2015, 06:08:07 pm
Axis mapping is usually defined by the driver, not SFML itself. So the first thing to do would be to check the mapping with an external tool.
Title: Re: Single or separate axis for Xbox controller
Post by: Jabberwocky on May 07, 2015, 07:02:33 pm
Thanks Laurent.

I found some more info on this. 
http://en.wikipedia.org/wiki/DirectInput#Xbox_360_Controller_support (http://en.wikipedia.org/wiki/DirectInput#Xbox_360_Controller_support)

Quote
An Xbox 360 Controller, with the default Microsoft driver, has the following limitations with DirectInput, compared to XInput:

- the left and right triggers will act as a single axis representing the signed difference between the triggers, not as independent analog axes
- vibration effects will not operate
- querying for headset devices will not operate

None of these limitations exist if using the Xbox 360 Controller with XInput.

Given what I know of SFML's philosophy, I doubt there's any interest to provide an XInput back-end to support XBox controllers, which is understandable.  It's a Microsoft design blunder (there is some discussion of this on the wiki linked above).  But the single axis is an annoying limitation. 
Title: Re: Single or separate axis for Xbox controller
Post by: Mario on May 11, 2015, 08:57:59 am
Given what I know of SFML's philosophy, I doubt there's any interest to provide an XInput back-end to support XBox controllers, which is understandable.

It's probably nothing short-term. But if there are ever thoughts about providing haptic/force feedback on desktop systems, this would be a freebie addition.

I guess the biggest thing is just the need for the DirectX SDK and how it's kinda "wonky" when used with MinGW (although I might not be up to date there).
Title: Re: Single or separate axis for Xbox controller
Post by: HornetMaX on June 25, 2015, 08:03:29 pm
Given what I know of SFML's philosophy, I doubt there's any interest to provide an XInput back-end to support XBox controllers, which is understandable.  It's a Microsoft design blunder (there is some discussion of this on the wiki linked above).  But the single axis is an annoying limitation.
I surely +1 this.

On various games, the game does support xinput just because of that "single axis triggers mess".
Would be nice if SMFL had support for xinput.

MaX.