Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Single or separate axis for Xbox controller  (Read 9348 times)

0 Members and 2 Guests are viewing this topic.

Jabberwocky

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Single or separate axis for Xbox controller
« 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?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Single or separate axis for Xbox controller
« Reply #1 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!
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Jabberwocky

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: Single or separate axis for Xbox controller
« Reply #2 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.
« Last Edit: May 07, 2015, 03:33:27 pm by Jabberwocky »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Single or separate axis for Xbox controller
« Reply #3 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Jabberwocky

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: Single or separate axis for Xbox controller
« Reply #4 on: May 07, 2015, 04:21:19 pm »
Your definition of "hijack" and "unrelated" must be slightly different than mine.  ;)

« Last Edit: May 07, 2015, 04:24:15 pm by Jabberwocky »

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: Single or separate axis for Xbox controller
« Reply #5 on: May 07, 2015, 04:46:34 pm »
Single axis (Z) in 2.2 and older.  :( :( :(

Jabberwocky

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: Single or separate axis for Xbox controller
« Reply #6 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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Single or separate axis for Xbox controller
« Reply #7 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Jabberwocky

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: Single or separate axis for Xbox controller
« Reply #8 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).

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Single or separate axis for Xbox controller
« Reply #9 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.
Laurent Gomila - SFML developer

Jabberwocky

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: Single or separate axis for Xbox controller
« Reply #10 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

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. 

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Single or separate axis for Xbox controller
« Reply #11 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).

HornetMaX

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Re: Single or separate axis for Xbox controller
« Reply #12 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.