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

Author Topic: Controller mappings.  (Read 7175 times)

0 Members and 1 Guest are viewing this topic.

VCras

  • Newbie
  • *
  • Posts: 6
    • View Profile
Controller mappings.
« on: October 14, 2016, 06:31:53 pm »
I want my SFML program to support PS3, PS4, Xbox 360 and Xbox One controllers, on Mac and Windows. My understanding is that for every OS (and driver) there is a different mapping. Are there comprehensive lists of these mappings online? ( I've googled 'controller mappings' extensively.) I don't have Xbox 360 or Xbox One controllers, and so cannot test everything. Cheers.

korczurekk

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • Email
Re: Controller mappings.
« Reply #1 on: October 14, 2016, 09:06:27 pm »
Just write some editor so player can set mapping of his controller by himself.

VCras

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Controller mappings.
« Reply #2 on: October 14, 2016, 09:24:11 pm »
I have - but it's not pretty, because remappers have images of the mapping displayed on the screen, e.g
Jump - [A] (as an image, rather than Output 13 or whatever)
In order to do this, I need the mappings!
In addition, there are a lot of fun little games out there, and it should be as easy as humanly possible for players to just pick up and play - few games force the player to involuntarily remap (edit: map inputs to outputs) immediately, as this is hassle.
So I disagree.


korczurekk

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • Email
Re: Controller mappings.
« Reply #3 on: October 14, 2016, 11:11:29 pm »
Okey,
As far as I know, some things are universal and this http://www.carvware.com/images/screenshots/XBOX360Controller.png will most likely work. Then if you use sf::Joystick::isButtonPressed(0, 1); (or 0, all buttons may have ID decrased by 1) it should detect whether 'A' is pressed or not.

//edit: At least it worked when I did this with PS3 & PS4 controllers, I don't have an XBox.

VCras

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Controller mappings.
« Reply #4 on: October 14, 2016, 11:42:32 pm »
Thank you for the image - that's very useful! :) It surprises me that mappings are hard to find. It would be fantastic for a comprehensive list to be available online - especially as I suspect they may differ across operating systems.

Edit: I'm finding it really hard to find Xbox One mappings.

Edit: this thread has Xbox 360 mappings: http://en.sfml-dev.org/forums/index.php?topic=16748.msg120279#msg120279 Seems funny that both triggers share an axis!
« Last Edit: October 14, 2016, 11:57:33 pm by VCras »

 

anything