SI_BUTTON_EVENT never arrives in the application

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

Moderator: Moderators

Post Reply
artistlsm
Posts: 6
Joined: Tue Nov 26, 2013 7:54 am

SI_BUTTON_EVENT never arrives in the application

Post by artistlsm »

Hi there,

I wrote a small console application to study the input behavior before integrating the input listener into our commercial application.

One peculiar behavior that I notice is that the application never receives the SI_BUTTON_EVENT messages, note that other event messages such as SI_MOTION_EVENT, SI_ZERO_EVENT, etc appear as expected when the 3D mouse is adjusted. Because of that, I took some time analyzing the demo projects came with the SDK. It turns out that 3 out of 4 of the demo applications do not receive the Button events either. Is this a known issue?

The only demo application that receives the button events is the 3DxTest program. What makes thing Interesting enough is that, as soon as the executable is renamed to something else, the same application will stop receiving the button event in the next run. Renaming it back to "3DxTest" again will return the magic.... So, it seems to me that there's a logical layer that monitors the active application and only emit the button events if certain conditions are met, such as having a application name called "3DxTest".

Can the dev team confirm this, please?
In that sense, how could 3rd parties developer configure such that we can receive the button events and disable the on-screen circular menu offered by the 3DConnexion software?

Thanks.
artistlsm
Posts: 6
Joined: Tue Nov 26, 2013 7:54 am

Re: SI_BUTTON_EVENT never arrives in the application

Post by artistlsm »

Some additional info that might help the dev team to trace the root cause:

Input Device : SpaceMouse Wireless
Software: 3DxWare 10 (64-bit) 10.0.19
SDK: 3DxWare SDK 3.0.2
OS: Windows 8 64 bit


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

Re: SI_BUTTON_EVENT never arrives in the application

Post by jwick »

The default profile may redirect all the button events to some sort of driver function instead of sending them on to your application.
You need to create a profile for your application and set all the buttons to be sent to your app (like the 3DxTest profile). The executable name is specified in the profile.
artistlsm
Posts: 6
Joined: Tue Nov 26, 2013 7:54 am

Re: SI_BUTTON_EVENT never arrives in the application

Post by artistlsm »

jwick wrote:The default profile may redirect all the button events to some sort of driver function instead of sending them on to your application.
You need to create a profile for your application and set all the buttons to be sent to your app (like the 3DxTest profile). The executable name is specified in the profile.
Hi jwick,

Thanks for the reply.

This sounds logical. Maybe I overlooked something, actually I've read thru the SDK documentation earlier, but couldn't find anything regarding this part. I just looked it up again, the SDK doc does not cover anything about the app profile. Could you shed some light on where we could possibly find the detailed documentation about configuring our custom app profile? If I understand you correctly, we can configure this directly in our code, right? (Note that we have never used the 3D mouse for CAD nor 3D apps before, instead we are trying to prototype this for application in other domain)

Meanwhile, we found a workaround to redirect the button event callbacks to our application. Things work as soon as we configure the button settings explicitly in the 3DConnexion property window to the "Application Use" option in that drop down menu. In any case, we hope that there is a proper way of defining this in the code level. Thanks!

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

Re: SI_BUTTON_EVENT never arrives in the application

Post by jwick »

The SDK doc just tells you how to use the API. The driver is a separate beast. The SDK works with both the old (3DxWare 6) and new (3DxWare 10) drivers.

The profiles are completely different with 3DxWare 6 and 10. 10 is all you should be working with. On 10, they are XML files. Your application should not be doing anything with the driver's profiles. It is up to the author (you), the user and the driver to maintain those. You don't want to be tied to a specific implementation of the driver.

Still, you should deliver a profile with your application that is tuned to the specifics of your application. If nothing else a profile for your application will display the correct name on the device's LCD.

The key to getting button events in your application is to have the buttons assigned to the "App_PassToApplication" ActionID. Make as little changes as possible to the profile you ship. For instance, if you assign all buttons to go to your application, you will disable the radial menus that some users like. There are some buttons that are obviously reprogrammable: the buttons labeled 1-n, T, R, L, F, etc. I'd try to stay away from reprogramming something like Shift to prevent user confusion. It is your solution, but we'd like to see some consistency when users switch from one application to another.

Creating a profile is a separate authoring task. The GUI that used to help you do this has been deprecated, so you are forced to do this authoring task on your own with your favorite xml editor.

This should be the correct manual procedure:
1) Make a copy of <3DxWinCore directory>/Cfg/AppDefCfg_S80.xml using your application name for the filename.
2) Change the AppInfo/Name to the common name of your program (e.g., Microsoft Outlook) and AppInfo/ExecutableName field to the name of your executable (e.g., Outlook.exe).
3) Save the file into: %programdata%\3Dconnexion\3DxWare\Cfg. (Your installer should put your profile here)

When your application executable gets focus, the driver will load your profile. When users make changes, the differences from your default file will be saved under %appdata%.
artistlsm
Posts: 6
Joined: Tue Nov 26, 2013 7:54 am

Re: SI_BUTTON_EVENT never arrives in the application

Post by artistlsm »

Hi JWick,

Thank you very much for the kind answers!
This is indeed a very important piece of information that we lacked earlier. And now it explains everything neatly.

Having gotten a clearer overview now, we asked ourselves if there's a separate API that we could use to get some useful information from the driver side during runtime? Particularly the instantaneous nominal range of the 3D mouse. At the moment, "hooking" our plugin application via Windows API allows us to receive the mouse move and button event like the demo 3DxTest demo app. The only difference we experience is that the full range observed in 3DxTest is 350, while the one we observed in our application is around 2060 (for the default "overall speed" setting).

We are currently experimenting the 3D mouse (via a newly built plugin component) on a professional production software application that is not CAD nor 3D graphic design application.
In some cases, we would need to translate the data to a normalized value apart from utilizing the relative reading in some other control modes. In that case, knowing the max range value is essential.
Hope that you could shed some light on this part too. Many thanks!
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: SI_BUTTON_EVENT never arrives in the application

Post by jwick »

Did you create a profile for your application? Please PM me that profile.
artistlsm
Posts: 6
Joined: Tue Nov 26, 2013 7:54 am

Re: SI_BUTTON_EVENT never arrives in the application

Post by artistlsm »

jwick wrote:Did you create a profile for your application? Please PM me that profile.
Yes, we did. Have sent the profile in a PM. Thanks!
Post Reply