TDx.TDxInput.dll for .NET 4.0

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

Moderator: Moderators

Post Reply
CarlEmail
Posts: 6
Joined: Sat Mar 23, 2019 5:27 am

TDx.TDxInput.dll for .NET 4.0

Post by CarlEmail » Sat Mar 23, 2019 5:37 am

I have been using the SpaceNavigator in Unity (the game engine) successfully for some time, but now that Unity is deprecating .NET 3.5 it is no longer possible to build working applications using SpaceNavigator. That is a shame.

I am using the "SpaceNavigator Driver" extension available on the Unity Asset Store. However, the problem lies not in the extension, but in the TDx.TDxInput.dll which is compiled for .NET 3.5. I have just downloaded the latest 3DWare drivers and TDx.TDxInput.dll remains .NET 3.5.

Is there any chance that 3DConnextion can provide a TDx.TDxInput.dll compiled for .Net 4.0?

All the best
Carl Emil

ngomes
Moderator
Moderator
Posts: 1945
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: TDx.TDxInput.dll for .NET 4.0

Post by ngomes » Mon Mar 25, 2019 8:48 am

Hi CarlEmail,

3DxInput is a deprecated interface. The driver still ships with a build to ensure older software can still operate in end-users machines but it's not intended for new development.

Recent version of the 3DxWare SDK have a .NET sample, TestSiapp. Our recommendation is to port the software to the driver's official API.
Nuno Gomes

CarlEmail
Posts: 6
Joined: Sat Mar 23, 2019 5:27 am

Re: TDx.TDxInput.dll for .NET 4.0

Post by CarlEmail » Thu Oct 24, 2019 8:59 am

I have returned to the problem of implementing SpaceNavigator input in .NET 4.0 Unity builds.

I am looking at the TestSiapp example. So far I've imported siappdll and Siapp.cs into Unity. I am now trying to recreate the functionality of Form1.cs and here I get stuck. The Form1 class inherits from Form which is not accessible. Somehow Message msg is send to the WndProc method after InitializeSiApp() is called in the Form1 constructor. How exactly do I subscribe to messages? I hope I don't need to point to a form window, because I am not sure such a concept exist in Unity.

All the best
Carl Emil

ngomes
Moderator
Moderator
Posts: 1945
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: TDx.TDxInput.dll for .NET 4.0

Post by ngomes » Mon Oct 28, 2019 1:03 am

Hi Carl,
How exactly do I subscribe to messages? I hope I don't need to point to a form window, because I am not sure such a concept exist in Unity.
Ultimately, the driver relies on a window to send messages to. To subscribe to messages sent by the driver, the client program calls SiOpen (as demonstrated in the TestSiapp demo).
If the Unity Engine does not allow access to the low-level native window, perhaps one approach is to create a managed assembly (in C#, say) and create a wrapper to the native 3D mouse driver API. I think the TestSiapp demo can be used as a first stepping stone to building the assembly.

CarlEmail
Posts: 6
Joined: Sat Mar 23, 2019 5:27 am

Re: TDx.TDxInput.dll for .NET 4.0

Post by CarlEmail » Mon Oct 28, 2019 1:12 am

Hi NGomes, thanks for the responding.
ngomes wrote:
Mon Oct 28, 2019 1:03 am
perhaps one approach is to create a managed assembly (in C#, say) and create a wrapper to the native 3D mouse driver API.
So the assembly would then open a window in the background to receive input? Is there absolutely no way to avoid the creation of a window?

All the best
Carl Emil

ngomes
Moderator
Moderator
Posts: 1945
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: TDx.TDxInput.dll for .NET 4.0

Post by ngomes » Mon Oct 28, 2019 2:37 am

CarlEmail wrote:
Mon Oct 28, 2019 1:12 am
So the assembly would then open a window in the background to receive input? Is there absolutely no way to avoid the creation of a window?
Correct. Having a window is required to use the driver API.

CarlEmail
Posts: 6
Joined: Sat Mar 23, 2019 5:27 am

Re: TDx.TDxInput.dll for .NET 4.0

Post by CarlEmail » Mon Oct 28, 2019 7:02 am

ngomes wrote:
Mon Oct 28, 2019 2:37 am
Having a window is required to use the driver API.
Does the window need to be focused for input to be received?

ngomes
Moderator
Moderator
Posts: 1945
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: TDx.TDxInput.dll for .NET 4.0

Post by ngomes » Mon Oct 28, 2019 12:37 pm

CarlEmail wrote:
Mon Oct 28, 2019 7:02 am
Does the window need to be focused for input to be received?
No but it should be created by the process that creates the focus window. Ideally, you'd want to have the focus window as the parent of the hidden window or somewhere along the parent hierarchy.

CarlEmail
Posts: 6
Joined: Sat Mar 23, 2019 5:27 am

Re: TDx.TDxInput.dll for .NET 4.0

Post by CarlEmail » Fri Nov 08, 2019 5:47 am

The TestSiapp example app needs window (Form) focus to receive input. I wonder if you have any hints how to make it work while unfocused?

ngomes
Moderator
Moderator
Posts: 1945
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: TDx.TDxInput.dll for .NET 4.0

Post by ngomes » Fri Nov 08, 2019 7:56 am

CarlEmail wrote:
Fri Nov 08, 2019 5:47 am
The TestSiapp example app needs window (Form) focus to receive input. I wonder if you have any hints how to make it work while unfocused?
Refer to SiGrabDevice in the SDK documentation. It will allow your program to receive 3D mouse data when the process loses input focus.

Post Reply