Cannot get event when device is connected or disconnected

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

Moderator: Moderators

Post Reply
abenedik
Posts: 2
Joined: Mon Apr 03, 2017 11:42 am

Cannot get event when device is connected or disconnected

Post by abenedik »

According to the SDK documentation, the "SI_DEVICE_CHANGE_EVENT is sent when a device is connected or disconnected from the system."

But I am not able to get that event from SpaceNavigator (FW: 4.35).

I have tried with the latest version (v10.4.10) on Windows 10 and with an older version on VMWare Windows 7 (version 10.2.9).
In both cases I have tried that in my .Net application that uses siapp.cs and also with the Demos\TestSiapp application that comes with the SDK.
Also, the old TDx.TDxInput library does not work in this case - the DeviceChange event is not fired.

It looks to me that the only way to get information if the device is disconnected is to call the SiGetDeviceInfo and if the value of devType in the returned class is 0 (Unknown), then the device was disconnected.
In case user connects the device, an SI_IS_EVENT event is sent and its type is 0 - if the device was disconnected before we can call SiGetDeviceInfo to confirm if device is now connected.

Is it ok to call SiGetDeviceInfo every few seconds after the last event to check if the device is disconnected?
Or is there another solution to get the SI_DEVICE_CHANGE_EVENT working.
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Cannot get event when device is connected or disconnecte

Post by jwick »

Sending DeviceChange events are disabled by default in the cfg file that is used if there is no cfg file for your application (AppDefCfg_s80.xml).

Code: Select all

    <Options>
      <IgnoreMouseWheelInertia>true</IgnoreMouseWheelInertia>
      <SendDeviceChangeEvent>false</SendDeviceChangeEvent>
      <UseSiOpenAppName>true</UseSiOpenAppName>
    </Options>
If you create a cfg for your application, you can turn it on (true).
UtaSH
Moderator
Moderator
Posts: 3754
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Re: Cannot get event when device is connected or disconnecte

Post by UtaSH »

Moving topic to the Developer Forum.
Post Reply