SFML community forums
Help => Window => Topic started by: zenroth on May 05, 2013, 08:08:09 pm
-
So I've been using some of the old RC 2.0 code for probably a good year or two without problems, however it seems I've ran into an issue now. I'm now using a Logitech m570 wireless trackball, and games instantly crash when checking for a mouse press. This is likewise present in our previous commercial releases. The crash seems to happen at IOHIDElementGetDevice.
Now I downloaded the latest SFML and I no longer seem to get a crash, but the trackball does not work at all. Debugging the code a bit it seems like SFML detects 3 mice with the following button counts 940,7,39. This seems strange to me, as I would have expected at most 2 mice to be detected, but I'm not familiar with this API any.
Some left, right and other buttons do get detected and added to the m_Buttons array, but in the end the trackball buttons seem to do nothing.
I also checked out some games like FTL that use SDL and the trackball seems to work fine there, so it seems like its not a global issue. The trackball also works fine under SFML and Windows.
-
The thing is, there is pretty much no documentation about IOHID API. And not having such device makes it really hard for me to test my code..
If I find some free time I'll go dig into SDL code to see what they are doing better. But this is unlikely to happen soon unfortunately.
Of course, any (good :-) ) contribution on that particular topic is welcome.
-
Understood, I'll see what I can figure out with it. I was surprised that most of the IOH objects seemed to have no information exposed in the debugger. Didn't look very friendly to say the least.
-
So this seems to be a bigger issue. Multi-mouse support in general seems to not be working.
If i connect a regular usb mouse into my macbook pro, no clicks are detected, only clicks from the touchpad register.
I'm unfortunately unclear why this is.. Ive added a ton of debug stuff to the IOH code and it sees the usb optical mouse, detects the buttons, adds it to the m_Buttons array, but when checking in IsMouseButtonDown the IOH value always comes back as 0.
-
Also note that mouse events work fine with the trackball and other external mice, it seems like its only the IOH api that isn't working..
A quick examination of SDL and glfw both seem to indicate that neither use IOH for mouse or keyboard handling, unless I missed something.