button values from 3d space mouse

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

Moderator: Moderators

AntonyAlbertAnto
Posts: 17
Joined: Wed Mar 24, 2021 1:09 pm

button values from 3d space mouse

Post by AntonyAlbertAnto »

Hi,

I would really appreciate if someone could help me to get me a vb.net code to get the button values from 3d space mouse while I am pressing them.
There are 2 buttons left and right buttons on 3d space mouse. If I could know the values I could assign actions while the buttons are pressed.
jwick
Moderator
Moderator
Posts: 3328
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: button values from 3d space mouse

Post by jwick »

I assume you have a SpaceNavigator-type (two button) device.
By default, those are assigned to show radial menus and nothing is sent to the application.

Which API are you using to read the device?

Is this for use in a single application that you are writing, or a general utility?
If you are just trying to have the buttons do something in other applications, there are ways of doing this with the driver.
AntonyAlbertAnto
Posts: 17
Joined: Wed Mar 24, 2021 1:09 pm

Re: button values from 3d space mouse

Post by AntonyAlbertAnto »

Hi jwick,

Thanks for responding.
I got the code from this forum to see the values of 6 axis of the 3D space mouse while they are moved.
Now, I would like to see the values of the buttons while they are pressed.
I am using 'windows forms app (.NET)' in Visual studio 2019 for coding (VB .net).
jwick
Moderator
Moderator
Posts: 3328
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: button values from 3d space mouse

Post by jwick »

You are using our TDxInput assembly?

Probably the default cfg file is being used for your application. You will see the cfg in use if you hover over the 3Dx systray icon.

Do you see Radial Menus come up when you press the buttons?

You can use the GUI to assign those buttons to events that will be sent to your application, instead of showing Radial Menus. Depending on what cfg gets loaded, you should see something like "Application Use" in the GUI when assigning button actions.
AntonyAlbertAnto
Posts: 17
Joined: Wed Mar 24, 2021 1:09 pm

Re: button values from 3d space mouse

Post by AntonyAlbertAnto »

Hi jwick,

I tried the way you mentioned, that using GUI instead of radial menus but it didnt work.
Is there some vb code to access the 2 buttons.
jwick
Moderator
Moderator
Posts: 3328
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: button values from 3d space mouse

Post by jwick »

Run your program, then start our GUI. Change some button assignment on your 3D mouse.
This will generate an xml file in %appdata%\3dconnexion\3DxWare\Cfg named for your program.
PM that file to me.
AntonyAlbertAnto
Posts: 17
Joined: Wed Mar 24, 2021 1:09 pm

Re: button values from 3d space mouse

Post by AntonyAlbertAnto »

Hi Jwick,

I have sent the xml file through PM.
jwick
Moderator
Moderator
Posts: 3328
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: button values from 3d space mouse

Post by jwick »

Hi AntonyAlbertAnto,

Your file looks fine.
I assume it is getting selected when Prog_Reg_Test1.exe is in focus.

I see you have a two button SpaceMouse Compact.

Does your executable get started when you press the left button?
You are starting another instance of the application from the application?

Your application should be getting a native application button event (10) when you press the right button.
Your app gets nothing? This type of button event was supported from the very beginning.
You could also assign both to:

Code: Select all

     <Output>
          <ActionID>App_PassToApplication</ActionID>
Then you would get a 1 for the left button and a 2 for the right button (I may have right/left reversed).

We have not had any reports of TDxInput not working, but we haven't tried to keep it up-to-date in years.
We would be very interested in hearing that there are issues with it.

You get axis events using this file?
AntonyAlbertAnto
Posts: 17
Joined: Wed Mar 24, 2021 1:09 pm

Re: button values from 3d space mouse

Post by AntonyAlbertAnto »

I got the axis values using TDxinput. Likewise how could I get the Value 1 and 2 while pressing right and left button using Visual basic coding language
jwick
Moderator
Moderator
Posts: 3328
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: button values from 3d space mouse

Post by jwick »

Are you getting the 10?
AntonyAlbertAnto
Posts: 17
Joined: Wed Mar 24, 2021 1:09 pm

Re: button values from 3d space mouse

Post by AntonyAlbertAnto »

Hi jwick,

I didnt get you. where should i see 10 or how?
jwick
Moderator
Moderator
Posts: 3328
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: button values from 3d space mouse

Post by jwick »

The cfg file you sent me sends a button 10 event to your application when the user presses the right button on the SpaceMouse Compact.
Do you get that event?
Is the code responding to any button events?
AntonyAlbertAnto
Posts: 17
Joined: Wed Mar 24, 2021 1:09 pm

Re: button values from 3d space mouse

Post by AntonyAlbertAnto »

Hi Jwick,
No, I am not getting any events. nothing happens while I press right or left button.
I do not have a vb codeline to see them.
jwick
Moderator
Moderator
Posts: 3328
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: button values from 3d space mouse

Post by jwick »

Can you give us your code to have a look at what you are doing? Preferably a small sample without your application-specific code.
AntonyAlbertAnto
Posts: 17
Joined: Wed Mar 24, 2021 1:09 pm

Re: button values from 3d space mouse

Post by AntonyAlbertAnto »

Hi Jwick,
I have send the sample in PM.
Post Reply