Expected behavior of radial menu

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
chrols
Posts: 3
Joined: Tue Aug 14, 2018 6:29 am

Expected behavior of radial menu

Post by chrols » Tue Aug 14, 2018 6:54 am

I am in the process of implementing support for 3DConnexion's Space Mouse in my company's application. I note that when testing with a SpaceNavigator that the default right button radial menu emits SI_BUTTON_EVENT events rather than SI_CMD_EVENT events that I had expected.

This radial menu is called "RM Views" and contains "Front View", "Top View", "Right View" and "Fit". Here only "Fit" has an icon. If I go to the button configuration under properties I note that the "RM Views" radial menu option does not appear selected. If I then select the "RM Views" radial menu I end up with a radial menu that has the same options, but have icons and emit SI_CMD_EVENT events. Revisiting the button configuration the "RM Views" now appear selected.

The old behavior can be restored by creating a new radial menu and then deleting it.

From my reading of the SDK documentation the default behavior should be for the 3Dconnexion driver is to emit SI_CMD_EVENT events or possibly SI_APP_EVENT events on button presses. From my reading SI_BUTTON_EVENT is only emitted if it is specifically requested by a configuration file, which in turn is discouraged.

This seems like a bug to me. Can it be ignored? Or have I misunderstood the documentation and need to handle SI_BUTTON_EVENT events as well?

My apologies if this is a known issue, but I could not manage to find anything when researching the issue.

jwick
Moderator
Moderator
Posts: 2481
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Expected behavior of radial menu

Post by jwick » Thu Aug 16, 2018 2:29 am

Yes, that seems like sort of a bug. We are using the same Radial Menu name for two different implementations. The user doesn't know which is being used and only one of them is available in the Radial Menu submenu. There is one for legacy interfaces (the SI_BUTTON_EVENT), and one for new apps that supports the suggested V3DCMDs (SI_CMD_EVENT). By default you are getting the legacy one.

If you want to support V3DCMSs (SI_CMD_EVENTS), add a call to set the USESV3DCMDS flag.
E.g., (Change the first arg to SiOpenEx to your application's name)

Code: Select all

  SiOpenWinInitEx (&oData, hWndMain);    /* init Win. platform specific data  */

  // Tell the driver we want to receive V3DCMDs instead of V3DKeys
  SiOpenWinAddHintBoolEnum(&oData, SI_HINT_USESV3DCMDS, SPW_TRUE);

  // Tell the driver we need a min driver version of 17.5.5.  
  SiOpenWinAddHintStringEnum(&oData, SI_HINT_DRIVERVERSION, L"17.5.5");

  /* open data, which will check for device type and return the device handle
  to be used by this function */
  if ((devHdl = SiOpenEx(L"3DxTest", SI_ANY_DEVICE, SI_NO_MASK, SI_EVENT, &oData)) == NULL)
  {
    SiTerminate();  /* called to shut down the SpaceWare input library */
    res = 0;        /* could not open device */
    return res; 
  }
This will pick the correct (new, V3DCMDs) default cfg file.

chrols
Posts: 3
Joined: Tue Aug 14, 2018 6:29 am

Re: Expected behavior of radial menu

Post by chrols » Thu Aug 16, 2018 7:18 am

Thank you for your answer, however I am afraid I am still somewhat confused.

From my understanding your answer is that I am seeing the SI_BUTTON_EVENT events because I have not requested the new style of events. However, while I have to apologize for neglecting to mention it, I am explicitly requesting VD3DCMDs which is the reason I was surprised by seeing the SI_BUTTON_EVENTs. From my understanding I should not see any SI_BUTTON_EVENT events if I request V3DCMDs. When I tested with a SpaceMouse Pro with more physical buttons it did not provide any SI_BUTTON_EVENT events. The code I use is almost a verbatim copy of the one you provided:

Code: Select all

    SiOpenWinInitEx(&oData, hwnd);    // init win platform specific data

    // Tell the driver we want to receive V3DCMDs instead of V3DKeys
    SiOpenWinAddHintBoolEnum(&oData, SI_HINT_USESV3DCMDS, SPW_TRUE);

    // Tell the driver we need a min driver version of 17.5.5.  
    // This could be used to tell the driver that it needs to be upgraded before it can run this application correctly.
    SiOpenWinAddHintStringEnum(&oData, SI_HINT_DRIVERVERSION, L"17.5.5");
It seems to me that you are saying that you have two "separate" menus that look the same but provide different events, and that the menu is chosen based on the preference of the application. However it seems to me like that the legacy ends up being the default even when the application has requested the V3DCMDs. This seems like a bug in the driver to me, but I may have misunderstood something.

I would prefer not to see any SI_BUTTON_EVENT events, am I incorrect in my understanding that my program should not be provided SI_BUTTON_EVENT events if I use the following line?

Code: Select all

 SiOpenWinAddHintBoolEnum(&oData, SI_HINT_USESV3DCMDS, SPW_TRUE); 

jwick
Moderator
Moderator
Posts: 2481
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Expected behavior of radial menu

Post by jwick » Wed Aug 22, 2018 9:07 am

I think you are right. The default behavior of the SN right/left buttons is to use a Radial Menu from Base.xml (Base_MenuRM2). This one does send SI_BUTTON_EVENTs.

You are the first one to catch that. You win the prize.

I can fix this but it won't see the light of day until the next release. I can send you the updated file, but it isn't practical to put files in the forum.
If you are not yet signed up as a developer, then please do. There is an email address on the developer page that you can use to request the updated file (I don't want to put the email address in the forum or it will get spammed).

Thanks for finding the bug.
Jim

chrols
Posts: 3
Joined: Tue Aug 14, 2018 6:29 am

Re: Expected behavior of radial menu

Post by chrols » Thu Aug 23, 2018 12:45 am

Thank you for the confirmation. It is reassuring to know that this is indeed a small bug and not indicative of some larger issue.

Regarding the fix: While I have a developer account registered I am in no immediate need of the fix. Additionally I believe deploying this file manually to end-users would be a much larger issue that the bug. This coupled with the fact that judging from your release notes you seem to update the software fairly regularly, I would be happy if the fix ended up in an upcoming release.

Thank you for you assistance in the matter.

Best regards,
/Christian

jwick
Moderator
Moderator
Posts: 2481
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Expected behavior of radial menu

Post by jwick » Wed Aug 29, 2018 12:59 am

Hello Christian,

I don't know when the next release will be. I don't want you to distribute a change to our files-that could be hard to track. I only suggested sending it to you to so you can verify your software. All it does is change the default assignment of that button to the one that you would set in the GUI.

Thanks again for noticing it.
Jim

Post Reply