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

Author Topic: Problems with controller on linux (ubuntu / SFML2.0)  (Read 3438 times)

0 Members and 1 Guest are viewing this topic.

Karleon

  • Newbie
  • *
  • Posts: 18
    • View Profile
Problems with controller on linux (ubuntu / SFML2.0)
« on: September 03, 2014, 11:42:54 pm »
Hello,

I implemented controller support for my game, and it was working correctly on windows.
I tried it on my laptop running ubuntu, and there was a strange behaviour:

My USB mouse is detected as a controller by SFML on ubuntu, having the contrer ID 1.
The X and Y axis return -100 and the GetButtonCount function said the controller had 320 buttons.

As a workaround, in my initialization I just check if the controller has less than 20 buttons. If it has more, the engine will ignore it. But I'm not really happy with this solution as I don't know if it would work for all possible scenarios (a controller with 13 buttons might be generated by another device, for example)

Do you guys have any idea what could be happening here or how to fix it?


Thanks!


Edit: Forgot to mention that I made sure to call sf::Joystick::update() during the initialization, before checking for any plugged in controllers.
« Last Edit: September 04, 2014, 12:09:21 am by Karleon »

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: Problems with controller on linux (ubuntu / SFML2.0)
« Reply #1 on: September 04, 2014, 12:15:20 am »
2.0 is not the last released version, maybe it's fixed in 2.1 or later.