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

Author Topic: Joystick doesn't work unless its connected before program starts  (Read 1872 times)

0 Members and 1 Guest are viewing this topic.

smurf

  • Newbie
  • *
  • Posts: 36
    • View Profile
Joystick doesn't work unless its connected before program starts
« on: November 20, 2023, 02:28:55 am »
If my joystick is connected and turned on when the game launches, everything seems ok. I can even turn it off, and turn it back on again, and it will keep working.

However if the controller is only turned on after the game has launched, it won't work. I see that the window.JoystickConnected event still fires when the controller comes on, HOWEVER, calling any of the query functions like Joystick.IsButtonPressed(i, 7) always returns false, and so does Joystick.IsConnected(i). Each frame I'm calling Joystick.Update().

How can I get SFML to notice the new controller? Like I said its already firing the JoystickConnected event, so IMO there should be no problem. But there is.


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Joystick doesn't work unless its connected before program starts
« Reply #1 on: November 20, 2023, 08:35:40 am »
Are you using SFML.Net?

We have three issues open regarding that and they aren't easily solvable.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

smurf

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Joystick doesn't work unless its connected before program starts
« Reply #2 on: November 20, 2023, 03:34:06 pm »
Yes I am!

Thanks I'll look at these links and see if it can help me (or if I can help out).

 

anything