Closed windingdk closed 2 years ago
Please try this branch and let me know if that fixes your problem. https://github.com/MobiFlight/MobiFlight-Connector/tree/883-spacemouse @windingdk
Tested it and it works. LGTM :-) thanks. @DocMoebiuz
One note. With the solution that you have implemented I guess that the buttons on the spacemouse will not work in Mobiflight, right?
@DocMoebiuz Shall I do more or will you create the pull request yourself?
Do the space mouse buttons show? I now changed it so that it only checks for button presses if buttons were found when querying the capabilities.
@DocMoebiuz not sure what you mean by show. Do you mean when the EnumerateDevices method runs? I think what you implemented is working. But I guess that a mouse click on the space mouse cannot be used with that implementation, right?
go to game controller settings in windows and check whether the space mouse buttons show there. To me it looks like they are not interpreted as Buttons in DirectX
@DocMoebiuz : I have this:
then everything should also show up in MobiFlight. That's very strange.
@windingdk since you have Visual Studio and Mobiflight Source Code, please do me a favor:
You said that isButton is not True, so what does the descriptor is telling us about the Buttons?
Can you find anything?
Also it might be helpful to log the information available about the aspect and share it with me. For example the 4 attributes before https://github.com/MobiFlight/MobiFlight-Connector/blob/058ee7eafcb71638430c983717e14cc163f75713/MobiFlight/Joystick.cs#L87
@DocMoebiuz It is bit strange.
Some OBS: When the program cycles through
private void EnumerateDevices()
it actually find axis and buttons. And the Buttons list also contains 4 buttons when it is done.
When I goto the game controller settings in Windows and pushes the buttons and/or control the axis nothing happens (buttons does not light up, no axis is moving. )
But when the exceptions occurs in the update method the Buttons list is empty! Does it make any sense to you.
I have made a screen dump of the buttons list when the exception occurs ( I disable the Buttons.Count statement that you inserted)
newState.Buttons[0] is true
One note: The space mouse if a configuable unit, depending on what program that runs. I am not sure if that can affect anything.
That indeed is very strange. The only reason i can think of why the button list is empty and then not might be that two devices are detected. Could that be the case?
@windingdk - i don't know how to proceed with this problem since I cannot reproduce it. If you can find out what the problem is let me know, but I will close this issue for now.
@DocMoebiuz for now i think it is a ok solution from my point of view. I have not been able to get closer to the cause.
@windingdk ok - I had added the fix into the official mobiflight beta already. You can try there and confirm that the exception is not raised anymore.
@DocMoebiuz I have just tested version 9.5.0.3. The fix works as expected.
Describe the bug I use this device (https://3dconnexion.com/uk/product/spacemouse-compact/) to control views. When I click on left/right mouse button I get an exception (see attached txt file) bug_spacemouse_exception.txt
Issue is 100% reproducible.
I have installed VS and tried to debug code. In UpdateButtons method in joystick.cs the Buttons list is empty (DeviceId = Buttons[i].Label).
I have checkedout main/ 582465a322be48d5505773c4cdaf768da50dcb08
I initialy found the bug in version 9.4.0 download here https://www.mobiflight.com/en/download.html
Further details: I have single stepped in EnumerateDevices to get more details
Method never finds IsAxis, IsButton, IsPOV. It finds a single "DeviceObjectTypeFlags.RelativeAxis".
Please let me know if I shall do some more debugging to solve this issue.