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: 2904
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: 2904
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.

SamF
Posts: 4
Joined: Tue Mar 10, 2020 3:55 am

Re: Get button events

Post by SamF » Wed Apr 22, 2020 2:41 am

Hello,
I am having a similar issue. I need to use the buttons in my application but am unable to change the button assignment in the GUI to "Application Use".
How can I press a button to trigger a method in my C# program? I am using the TestSiApp sample solution to read the mouse postions but am unable to retrieve the button events.
Thank you

nikos
Posts: 1
Joined: Tue Jul 27, 2021 5:35 am

Re: Get button events

Post by nikos » Tue Jul 27, 2021 6:14 am

Hello,
The new driver GUI has some default macros (eg. Undo, Redo, Cut, etc.).
My application has the ability to change these actions to other shortcuts but the default space-mouse macros will stay the same.

Eg. let's say the user changes undo command shortcut. I need the space-mouse Undo Macro to keep its functionality for my application. Having 2 Undo entries in the driver - GUI seems a little confusing.

Is there a way to achieve this, ie. have one Undo command which will do the intended both when my application is inside focus and outside? I am using the 3DxWare SDK v4 in my application.

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

Re: Get button events

Post by jwick » Mon Aug 02, 2021 5:30 am

I'm not following you.

Yes, it would be confusing if the user created a macro that had exactly the same name as one we pre-built. I don't know if we check for that. I don't think I've ever tried it.

At this time, user macros are application-specific. That user-created macro would be only visible in the application the user created it in.
There is no official way for a user to change one of the macros we have pre-built. All this is in user-accessible files, so it's not impossible...

For more info, I'd need a concrete example.

Post Reply