OnMouseWheel event fired by a 3D Mouse input

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

Moderator: Moderators

Post Reply
eduardobrites
Posts: 9
Joined: Wed Oct 09, 2013 7:31 am

OnMouseWheel event fired by a 3D Mouse input

Post by eduardobrites »

In my application I want to disable the 3DMouse input which acts like the 2DMouse scroll wheel.

The problem is that inside my OnMouseWhell event handler I don't know how to distinguish whether it was a 3D Mouse input or a 2D Mouse input.

Code: Select all

private void OnMouseWheel(object sender, MouseWheelEventArgs e)
{
    //My code here
}
Even if I disable this 3D Mouse functionality in the Properties context menu, sometimes the event is fired anyway (I don't know if it is a bug of the SpaceNavigator ).

Any workarounds?
ngomes
Moderator
Moderator
Posts: 3321
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: OnMouseWheel event fired by a 3D Mouse input

Post by ngomes »

Hi eduardobrites,

There is a feature in the driver included in 3DxWare 10 that emulate a mouse wheel. The event injection is done at a very low level and I believe, by the time the application is called back, the events are indistinguishable from a mouse wheel.

You probably have 3D mouse support using a system interface and the driver ends up feeding data to your application through two pathways: mouse wheel emulation and real 3D mouse data. Is that a fair assessment? It may be possible to address this by changing the driver configuration when your application is on the foreground.
eduardobrites
Posts: 9
Joined: Wed Oct 09, 2013 7:31 am

Re: OnMouseWheel event fired by a 3D Mouse input

Post by eduardobrites »

Hi ngomes,

That is exactly my situation.

How can I change the driver configuration whenever my application starts?
ngomes
Moderator
Moderator
Posts: 3321
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: OnMouseWheel event fired by a 3D Mouse input

Post by ngomes »

It depends on the driver stack that is installed.

Would you consider using the API? Depending on the system interface that you already have implement, the change may be minimal.
eduardobrites
Posts: 9
Joined: Wed Oct 09, 2013 7:31 am

Re: OnMouseWheel event fired by a 3D Mouse input

Post by eduardobrites »

My application is using .NET Framework 4 (C#) and I'm listening to the 3D mouse input events by using the RegisterRawInputDevices windows API, how can I use the API to perform that driver's setting change?
ngomes
Moderator
Moderator
Posts: 3321
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: OnMouseWheel event fired by a 3D Mouse input

Post by ngomes »

You would use the driver API to replace Raw Input.

If you can share, could you let us know why Raw Input is requirement?

You're probably using the driver in the "3DxSoftware" suite. Can you try using the driver in the newer 3DxWare 10 for Windows package? You will find the latest version (10.0.17) in the download section for the SpaceMouse Wireless.
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: OnMouseWheel event fired by a 3D Mouse input

Post by jwick »

If you use 3DxWare 10, you have to make a Cfg for your application using the RawInput template. Make sure your Transport is "RawInput"

Code: Select all

<Transport>RawInput</Transport>
Your profile will be the only one in use while your application is running.
eduardobrites
Posts: 9
Joined: Wed Oct 09, 2013 7:31 am

Re: OnMouseWheel event fired by a 3D Mouse input

Post by eduardobrites »

I'm using the RawInput method because I didn't see any examples of using the 3DxWare in a .NET application. The C# example in ftp:/ *** *** uses this method.

Also, I've heard that TDxInput is been deprecated. Is this incorrect?


Moderator Edit: the sample code is no longer available from the FTP service. Please contact 3Dconnexion API Support if you need further assistance.
ngomes
Moderator
Moderator
Posts: 3321
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: OnMouseWheel event fired by a 3D Mouse input

Post by ngomes »

eduardobrites wrote:Also, I've heard that TDxInput is been deprecated. Is this incorrect?
3DxInput is likely to be reinstated but we do not yet have a final decision on that.

Using Raw Input ought to be fine provided your users have 3DxWare 10 installed (and not 3DxSoftware).
eduardobrites
Posts: 9
Joined: Wed Oct 09, 2013 7:31 am

Re: OnMouseWheel event fired by a 3D Mouse input

Post by eduardobrites »

The problem is that even if I disable the mouse wheel emulator function, the mousewheel event is still fired.

Image

I have 3DxWare installed.
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: OnMouseWheel event fired by a 3D Mouse input

Post by jwick »

A different profile is probably being used than you think. Hover over the systray icon while your application is running to see what profile is being used.
eduardobrites
Posts: 9
Joined: Wed Oct 09, 2013 7:31 am

Re: OnMouseWheel event fired by a 3D Mouse input

Post by eduardobrites »

That did the trick.

Thank you!
eduardobrites
Posts: 9
Joined: Wed Oct 09, 2013 7:31 am

Re: OnMouseWheel event fired by a 3D Mouse input

Post by eduardobrites »

I just created a Profile for my application.

How can I deploy this profile to the end users for it to be loaded automatically whenever they run my application?
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: OnMouseWheel event fired by a 3D Mouse input

Post by jwick »

We haven't established a formal way of doing this yet.

For now your installer can drop it into the 3DxWinCore Cfg directory.

You can look up the 3DxWare install directory in the registry:
HKLM/Software/3dconnexion/3dxware/Home Directory
Subdirectory Cfg.
Post Reply