V3DK_FIT Doesn't appear to work

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

Moderator: Moderators

Post Reply
MarkMcC
Posts: 2
Joined: Tue May 26, 2015 5:45 am

V3DK_FIT Doesn't appear to work

Post by MarkMcC » Tue May 26, 2015 6:55 am

I've found a problem with one of the demos in the SDK. I'm also finding the same problem in my software. I got the mouse just over a week ago and installed all the latest drivers and SDK.

When I select "Fit" from the list, it thinks I'm zooming out. Top, right and front work correctly:
http://screencast.com/t/vLayEGWrz

This is the 3DxTstMFC project. The key value of the event is V3DK_MINUS instead of V3DK_FIT in the switch statement:

Code: Select all

switch((s3dm::e3dmouse_virtual_key)vkey)
{
  case s3dm::V3DK_INVALID:  /* Invalid key */
    break;
  case s3dm::V3DK_MENU:    /* Display application's menu */
    break;
My code currently has to do this to work which looks pretty dodgy:

Code: Select all

  case s3dm::V3DK_MINUS:    /* Decrease all axis scale by one level */
    fit();
    break;
Another product at my work looks for value 31 and then it knows it needs to zoom to fit. 31 is the value of V3DK_MINUS. It's been like that since August 2000!

I also want to be able to change the other menu on the space traveller mouse so that it immediately opens the properties, rather than making you choose between numpad, undo, redo, properties. Could anyone point me to somewhere that shows me how to do this?

ngomes
Moderator
Moderator
Posts: 1939
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: V3DK_FIT Doesn't appear to work

Post by ngomes » Thu Jun 04, 2015 2:07 am

Hi MarkMcC,

Very sorry for the delay in replying to your post.
When I select "Fit" from the list, it thinks I'm zooming out. Top, right and front work correctly:
http://screencast.com/t/vLayEGWrz
The demo is incorrect. It is processing a "V3DK" (which is a notification of a "virtual 3D mouse key" and not a specific device key.
The confusion comes from the fact that, originally, a "button" 31 event was used to "fit" the view.
We need to sort this out.
I also want to be able to change the other menu on the space traveller mouse so that it immediately opens the properties, rather than making you choose between numpad, undo, redo, properties. Could anyone point me to somewhere that shows me how to do this?
I'm not sure I follow. You'd like to change the default action assigned to a SpaceTraveler button?

Jenya
Posts: 2
Joined: Tue Mar 22, 2016 9:15 am

Re: V3DK_FIT Doesn't appear to work

Post by Jenya » Tue Mar 22, 2016 10:19 am

Hello,

I am seeing the same issue. The two applications that came with the SDK report two different values. The 3DxTest32 reports the "V3DK_FIT" whereas the 3DxTestMFC reports "Key '-' pressed". Values of for the "Fit" button are 2 and 31 in the corresponding applications. The Qt-based application that I am modifying to add the support for the 3DConnexion device also reports the value of 31 which is V3DK_MINUS.

Could you please explain the reason for the issue and what needs to be done about it.

Not sure if this is a related issue, but I also never receive the SI_CMD_EVENT neither in my Qt-based application nor in the sample 3DxTest32 that came with the SDK. I am forced to add my logic to the SI_BUTTON_RELEASE_EVENT instead.

Best Regards,
Jenya Burstein.

ngomes
Moderator
Moderator
Posts: 1939
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: V3DK_FIT Doesn't appear to work

Post by ngomes » Tue Mar 22, 2016 1:01 pm

Hi Jenya,
Could you please explain the reason for the issue and what needs to be done about it.
The SDK samples are inconsistent. This is a quality issue in our SDK and we're sorry for the confusion it may have caused you.

We're trying to steer our partners away from handling buttons directly precisely to avoid this sort of issue. Different devices will report buttons that are labelled the same with different ID numbers.

In the SDK, we have a section on the use of "V3DCMD" (virtual 3D commands). These will offer a much better abstraction of device buttons: developers implement the set of recommend functions and then the driver assigns the functions to the buttons that best match them.

Jenya
Posts: 2
Joined: Tue Mar 22, 2016 9:15 am

Re: V3DK_FIT Doesn't appear to work

Post by Jenya » Tue Mar 22, 2016 1:18 pm

ngomes wrote: In the SDK, we have a section on the use of "V3DCMD" (virtual 3D commands). These will offer a must better abstraction of device buttons: developers implement the set of recommend functions and then the driver assigns the functions to the buttons that best match them.
Thank you for the reply,

I have read the recommendation of handling the V3DCMD instead but, as I mentioned in my previous post, I do not appear to be receiving SI_CMD_EVENT events neither in my app nor in the sample app. Is there something that an application supposed to do to receive the SI_CMD_EVENT events?

Jenya Burstein

ngomes
Moderator
Moderator
Posts: 1939
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: V3DK_FIT Doesn't appear to work

Post by ngomes » Tue Mar 22, 2016 2:45 pm

Jenya wrote:Is there something that an application supposed to do to receive the SI_CMD_EVENT events?
It needs to have a driver profile. Normally, "default" profiles ship in the driver installer (the files are in the "Cfg" sub-directory of the driver installation folder). Developers can install a driver profile to %ProgramData%\3Dconnexion\3DxWare\Cfg and the driver will pick from there.

Since you're building an application that does not have a driver profile, I recommedn taht you replace the "AppDefCfg_S80.xml" file in the driver's "Cfg" sub-directory with the one in this package. Please use this file only for development purposes.

Open the "3Dconnexion Properties" panel, launch your application and make sure the driver recognises it (the panel should display the application name or the executable file name). Then open the "Buttons" panel (click the eponymous button) and assign one of the documented "V3DCMD" that you can now find the "3Dconnexion" category (click in the arrow on a button's right to bring up the action/command list).

I expect to have a solution for this issue (no V3DCMD available for application without a profile) resolved in 3DxWare 10 version 10.4.0. This version is expected to be released within two months. Let me know if this delay poses a problem to you as we will be able to assist, if necessary.

Again, we're sorry for the lack of proper support for what is a documented feature of the SDK.

f.Meier-Dörnberg
Posts: 1
Joined: Sat Dec 03, 2016 3:56 pm

Re: V3DK_FIT Doesn't appear to work

Post by f.Meier-Dörnberg » Sat Dec 03, 2016 4:00 pm

Hi,
I have the same problem with the current SDK (Nov. 2016).
Is there any progress on the matter?

abenedik
Posts: 2
Joined: Mon Apr 03, 2017 11:42 am

Re: V3DK_FIT Doesn't appear to work

Post by abenedik » Mon Apr 03, 2017 11:52 am

I would like to report that this is still not resolved (April 2017).

I am using SpaceNavigator and when FIT command is clicked in the radial menu, the code 31 is returned.
In SDK the value 31 is mapped to V3DCMD_FILTER_DOMINANT. The V3DCMD_VIEW_FIT is set to 2.

This is the same in V3DCMD.h and Siapp.cs

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

Re: V3DK_FIT Doesn't appear to work

Post by jwick » Tue Apr 04, 2017 12:50 am

I'll admit we aren't making this obvious.

There are several schemes for sending button events. We are evolving toward a more device-independent method, but the default cfg files we ship support the legacy, device-dependent methods. (We can't break old applications in the field).

You have to tell the driver which button event you want to receive when the user presses a button. To receive V3DCMD_* (e.g., V3DCMD_VIEW_FIT), you need a cfg file that assigns your buttons to V3DCMD_* ButtonActions.

Sign up as a developer and I can email you a file that does just that. I can't send emails through the forum.

Essentially, I'll be adding this in the UI section toward the end of the file:

Code: Select all

		<Category Sort="false">
			<ID>UI_V3DCMD_Views</ID><Name>V3DCMD Views</Name>
			<ButtonAction><ID>V3DCMD_VIEW_FIT</ID></ButtonAction>					
			<ButtonAction><ID>V3DCMD_VIEW_1</ID></ButtonAction>
			<ButtonAction><ID>V3DCMD_VIEW_2</ID></ButtonAction>
			<ButtonAction><ID>V3DCMD_VIEW_3</ID></ButtonAction>
			<ButtonAction><ID>V3DCMD_SAVE_VIEW_1</ID></ButtonAction>
			<ButtonAction><ID>V3DCMD_SAVE_VIEW_2</ID></ButtonAction>
			<ButtonAction><ID>V3DCMD_SAVE_VIEW_3</ID></ButtonAction>										
			<ButtonAction><ID>V3DCMD_VIEW_TOP</ID></ButtonAction>
			<ButtonAction><ID>V3DCMD_VIEW_LEFT</ID></ButtonAction>
			<ButtonAction><ID>V3DCMD_VIEW_RIGHT</ID></ButtonAction>
			<ButtonAction><ID>V3DCMD_VIEW_FRONT</ID></ButtonAction>
			<ButtonAction><ID>V3DCMD_VIEW_BOTTOM</ID></ButtonAction>
			<ButtonAction><ID>V3DCMD_VIEW_BACK</ID></ButtonAction>
			<ButtonAction><ID>V3DCMD_VIEW_ROLLCW</ID></ButtonAction>
			<ButtonAction><ID>V3DCMD_VIEW_ROLLCCW</ID></ButtonAction>
			<ButtonAction><ID>V3DCMD_VIEW_ISO1</ID></ButtonAction>
			<ButtonAction><ID>V3DCMD_VIEW_ISO2</ID></ButtonAction>
		</Category>
This shows these options in the GUI, which then allows you to map them to buttons. You don't need to see them in the GUI to map them, but it's a lot easier than editing xml files.

The whole idea of these cfg files is that only you the developer know what you added support for, and what you want to see in the GUI. The cfg file allows you to communicate this to your users. But we could be more helpful by providing templates to start with.

Post Reply