SFML community forums
Help => System => Topic started 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?
-
I've split this topic. Next time please don't necro a 5 year old thread to ask a completely unrelated question!
-
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.
-
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.
-
Your definition of "hijack" and "unrelated" must be slightly different than mine. ;)
-
Single axis (Z) in 2.2 and older. :( :( :(
-
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.
-
You might want to try SFML 2.3, the joystick code got quite a bit of change.
-
Cool, thanks eXpl0it3r.
I'll give that a shot when I pick up an x-box controller (busted my old one).
-
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.
-
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)
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.
-
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).
-
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.