Author Topic: Joystick controls - SFML issue  (Read 243 times)

Jontox

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Joystick controls - SFML issue
« on: November 11, 2020, 08:06:01 AM »
Hi All,

Something strange occurring here, I've got attractmode setup to my needs and was manipulating frontend from keyboard till now.
Then I connected my joystick "Hori Real Arcade Pro EX" to the computer via USB and then turn back to controls menu in attractmode TAB menu.

No Joystick input are detected.

I do confirm joystick is well installed and driver associated by win10 is "Xbox 360 Controller".
The joystick is working in win10 joystick test fonction and even tested on online flash games.

But attractmode seems to not recognized it at all.
Even in joystick mapping option for JOY0, JOY1, ... when I select JOY0 and hit enter the setting remains to "default", I am not able to select anything else.

I can't figure it out and I'm starting to loose my sanity on this one ...

Any comment or advise is welcome :)
« Last Edit: November 14, 2020, 02:11:35 PM by Jontox »

mahuti

  • Administrator
  • Sr. Member
  • *****
  • Posts: 128
    • View Profile
    • Github Repositories
Re: Joystick controls issue
« Reply #1 on: November 13, 2020, 09:58:29 PM »
I don't know much about this subject specifically... I've seen over the years posts about asigning specific drivers or using cronusmax.

Jontox

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: Joystick controls issue
« Reply #2 on: November 14, 2020, 02:11:18 PM »
Nice avatar mahuti, I've always liked Skeletor 8)

I've done a little a bit of research on this issue.
It seems it is not directly an attractmode bug but SFML linked.

https://en.sfml-dev.org/forums/index.php?topic=25361.0

This is exactly what it is displayed in attractmode console: "Failed to set DirectInput device axis mode: 1".
The consequence is that SFML deactivate the controller and that is why attractmode is not registering any input from mine.

In the same forum post, there is another user with the exact same issue.
As per one of the SFML team member: "Something must be registering itself as gamepad, but not actually support gamepad functionality.".

Indeed my controller is registering itself as a Xbox 360 Gamepad Controller, but what's the point ?

The driver automaticcaly installed by WIN10 is precisely Xbox 360 Controller and my joystick is indeed a Xbox 360 Hori joystick compatible with PC as well.
The joystick is perfectly working under WIN10 or any other game so why is SFML disabling it, it's out of my competence field.

Anyone with that same behavior, or any "free" workaround ?

mahuti

  • Administrator
  • Sr. Member
  • *****
  • Posts: 128
    • View Profile
    • Github Repositories
Re: Joystick controls - SFML issue
« Reply #3 on: November 14, 2020, 03:26:02 PM »
Quote
Nice avatar mahuti, I've always liked Skeletor

SFML, YOU NATTERING NINCOMPOOP, YOU COULDN'T DETECT DIRECTINPUT IF I BURIED YOU IN IT!
https://www.youtube.com/watch?v=mNz6eHfsESQ

So anyway.... maybe this?
https://joytokey.net/en/

SFML doesn't support DirectInput or Xinput as far as I know... so you'll need to convert that to keypresses I suppose. At least for AM.

Jontox

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: Joystick controls - SFML issue
« Reply #4 on: November 14, 2020, 11:03:14 PM »
Team SFML is really reactive.

Here is their reply:
This was changed in commit 3557c46. The last release of Attract-Mode was built before this commit was merged. Try building Attract-Mode with SFML master and see if this problem is fixed.

So potentialy the bug is solved but I need to build Attract-Mode with the new SFML master.

Is someone able to do it? Because honestly, I've never done it before... I'm not a developer...
It would be gratefully appreciated.

mahuti

  • Administrator
  • Sr. Member
  • *****
  • Posts: 128
    • View Profile
    • Github Repositories
Re: Joystick controls - SFML issue
« Reply #5 on: November 15, 2020, 02:20:04 AM »
I've done it a bunch on Linux. Haven't built it for Windows though.

https://github.com/mickelson/attract/blob/master/Compile.md

Looks like the recommended solution there for Windows is down towards the bottom. Look for "Windows (native compile)"

bionictoothpick

  • Sr. Member
  • ****
  • Posts: 320
  • He who laughs lasts.
    • View Profile
Re: Joystick controls - SFML issue
« Reply #6 on: November 16, 2020, 05:28:35 PM »
I use devreorder to hide the joysticks from attractmode. That stops the constant error message. And then I use antimicro to feed keys for joystick movements.

https://github.com/briankendall/devreorder
https://sourceforge.net/projects/antimicro.mirror/