Get button events

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

Moderator: Moderators

Post Reply
hart
Posts: 1
Joined: Fri Feb 16, 2018 3:05 am

Get button events

Post by hart » Fri Feb 16, 2018 3:20 am

Hello everyone,

I am new to 3DxWare and I am currently working on a Qt app on Windows 10 that captures the SpaceNavigator events (translations, rotations and button press) and send them on a network.
However, the app is not receiving the SI_BUTTON_EVENT, SI_BUTTON_PRESS_EVENT and SI_BUTTON_RELEASE_EVENT. I get the translation and rotation event but not the buttons.

When I click on a button, the radial menu pops and no event is captured at all.

I guess it got to do with the configuration of the device but how do you programmatically set that the mouse should pass the buttons events to the app instead of the current configuration?

Thanks a lot for the help!

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

Re: Get button events

Post by jwick » Fri Feb 16, 2018 9:23 am

Hello hart,

Yes, the default configuration does not send the buttons directly to you. Many are captured for things like Radial Menus & kb events.
You can see what cfg is being used now by hovering over the 3Dx systray icon when your app is running.

Does your application have a window that gets focus? If so, you can make a cfg for your application that passes the events directly to you w/o driver intervention.

It's difficult to send files on this forum. Can I ask you to sign up as a developer if you have not already done so? Then send an email to the API support contact and we can help you from there.

Jim
3Dx Software Dev

notkevinhise
Posts: 24
Joined: Thu Jun 20, 2019 8:33 am

Re: Get button events

Post by notkevinhise » Tue Sep 10, 2019 12:54 pm

"If so, you can make a cfg for your application that passes the events directly to you w/o driver intervention."

How can this be done?

You can't even use the sample applications for anything, such as 3Dxview.cpp and the method CSbtestmfcView::On3DMouse() because the driver intercepts the button events...they never get to the application.

Why do buttons have different values because they're held down longer before they're released?

Thanks.

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

Re: Get button events

Post by jwick » Wed Sep 11, 2019 12:51 am

Any button on any device can be sent directly to the app. For obvious reasons the driver implements certain buttons: Shift, Ctrl, Alt, etc.

On some devices, such as the two button devices, we have preassigned piemenus. These in effect give the user many more than two buttons.

To send the buttons directly to the app, the cfg file in use for the app has to assign the buttons to the ButtonAction "App_PassToApplication", in English, this is shown in the GUI as "Application Use". Normally this is available for assignment in the GUI. If not, it can be added to the GUI with a change of the XML file.

We generally don't recommend this particular approach though. It is device-specific. E.g., button 1 on one device is not the same as button 1 on a different device. A button is a button, but the buttons may have different labels printed on them. We recommend using the Virtual Button events, which are not device specific.

Some devices have LongPress buttons. If you hold them down long enough they will generate a secondary button event. It's like having an automatic shift key function. The SpaceMouse Pro, SpacePilot Pro and SpaceMouse Enterprise have a few of these. They are usually indicated by a blue secondary label printed on the button.

Post Reply