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

Author Topic: Problem with Joystick connected/disconnected events  (Read 4160 times)

0 Members and 1 Guest are viewing this topic.

AlterEgo

  • Newbie
  • *
  • Posts: 5
    • View Profile
Problem with Joystick connected/disconnected events
« on: November 22, 2018, 10:14:53 am »
I'm having some trouble with Joystick events. When I plug in my PS3 Dualshock 3 controller, I only get console output telling me that the controller was connected the first time the controller is plugged in. If I unplug the controller and plug it back in I no longer receive console output telling me that the controller was connected. I also never receive console output telling me that the controller was disconnected. However, even though the connected and disconnected events produce no console output, the button pressed event always does when a button is pressed.

Here is the code that handles the events:
(click to show/hide)

(click to show/hide)

Do you know what might be causing this behaviour? Any help would be much appreciated, thanks.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Problem with Joystick connected/disconnected events
« Reply #1 on: November 22, 2018, 10:37:20 am »
Which version of SFML are you using?
Laurent Gomila - SFML developer

AlterEgo

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Problem with Joystick connected/disconnected events
« Reply #2 on: November 22, 2018, 10:54:40 am »
SFML-2.4.2

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Problem with Joystick connected/disconnected events
« Reply #3 on: November 22, 2018, 11:25:08 am »
When you have issues, always try the latest version (2.5.1) before reporting them ;)
Laurent Gomila - SFML developer

AlterEgo

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Problem with Joystick connected/disconnected events
« Reply #4 on: November 22, 2018, 06:12:31 pm »
I updated the project to use SFML-2.5.1. Unfortunately the problem persists.

I would add to my first post that the "Controller connected!" output only appears if the controller is not plugged in when my machine is turned on and is then first plugged in when the program is running. If the controller is plugged into the machine when the machine boots up I receive no connection or disconnection related output when I run the program.

Do you have any idea what might be causing this? I find it quite strange.

Rosme

  • Full Member
  • ***
  • Posts: 169
  • Proud member of the shoe club
    • View Profile
    • Code-Concept
Re: Problem with Joystick connected/disconnected events
« Reply #5 on: November 23, 2018, 02:21:11 pm »
As far as I know, the PS3 controller is usually not recognized by Windows (and maybe other OS). You need a third party driver. Maybe that is the cause why SFML is not able to correctly interface with it?
GitHub
Code Concept
Twitter
Rosme on IRC/Discord

AlterEgo

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Problem with Joystick connected/disconnected events
« Reply #6 on: December 01, 2018, 03:55:41 pm »
Thanks for the reply Rosme. That's good advice, the only thing is that I can play games perfectly well with the controller and the SFML button pressed event works fine, so as far as I know that means the driver the controller is using is working fine. The only problem is that the joystick connected and disconnected events are not working properly.

Have you made any discoveries as to what it might be Laurent?

AlterEgo

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Problem with Joystick connected/disconnected events
« Reply #7 on: December 10, 2018, 05:45:20 pm »
Am I not going to receive any help with this issue? If there are any more details you need let me know and I'll do my best to provide them. I want to get to the bottom of this.

Also if you're reading this Laurent the issue persists with the latest version (2.5.1). I hope this qualifies the issue as worthy of investigation.