3DxWare SDK

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

Moderator: Moderators

Post Reply
Kieutrang
Posts: 2
Joined: Tue Aug 27, 2019 2:47 am

3DxWare SDK

Post by Kieutrang » Fri Aug 30, 2019 2:34 am

Hi all,

Sory if there is not correct thread for my question. I'm just novice at this forum and have a very important question to clarify.

The problems is the next:
We have 3D mouse control with analogue control and two buttons (LB & RB)
How can we detect what hardware button has been pressed with 3dXWare SDK. We get an event object (SIwEvent) that contains a great number of members (fields). One of them is HWButtonNuber, but this value really depends on assigned with 3D ware panel (for example LB - Button 1, we get hwButtonNumber = 2, if LB - Button 12, we get hwButton number = 1 << 12 = 4096, etc). It seems to be not HW, rather SW button. Also this structure contains message (char*) but it isn't value that was read by driver from device (i think so, because driver reads 7 bytes, first byte = 3 - indicates button pressing, and 4th byte at this case indicates HW button ID. But message field seems not to have these bytes, and it has software button number (probably button's mask) again. Future SIwEvent structure investigation leads to the next conclusion: all fields that have to mean button number depends on assigned with 3DWare panel button, so we can detect which physical button has been pressed (left button or right button).
Direct reading from USB is walkaround, but it's low programming level and I really hope that we can get HW button number through SDK functions.

Cheers,
Sergiy

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

Re: 3DxWare SDK

Post by jwick » Fri Aug 30, 2019 4:27 am

Hello Sergiy,

It is difficult to find out which physical button was actually pressed. This is on purpose. As new hardware devices get introduced, physical buttons come and go. We can't force ISVs to change their code each time we introduce a new hardware device.

We suggest that your code handle the generic/virtual button numbers. Users are free to remap those around to any physical button on the device they purchased. You generally don't have control over which device users buy, unless it is a turn-key system. Even then, eventually, devices will become unavailable, so you would be forced to support a new device.

Having said all that, you can create a cfg file that locks down the buttons for a specific device. If you have complete control over the user's system, this is possible. But users tend to try their best to get around any restrictions you put in place. We tend to allow them to do that and work with them rather than against them.

The API has functions that allow you to find out what users have done and try to overwrite what users are trying to do. I suggest you do not try to do that. It's a lot of work and just results in the users becoming confused.

You didn't mention what device you have. But I believe all two button devices default to putting up a pie menu when you press a button now. That's easily changed.

Post Reply