Using SpaceNavigator without window handle

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

Moderator: Moderators

Post Reply
christophe_95
Posts: 5
Joined: Mon Feb 18, 2019 2:00 am

Using SpaceNavigator without window handle

Post by christophe_95 » Mon Feb 18, 2019 4:15 am

Hello
Our application does not have a window handle
Is it possible to receive events directly from the driver ?

In the SDK, the call to SiOpenWinInit currently requires a window ID handle, which is annoying

Regards
Christophe

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

Re: Using SpaceNavigator without window handle

Post by jwick » Mon Feb 18, 2019 5:48 am

It's possible to have the driver send data through any mechanism you want, but it's a lot of work.

The HWND it is asking for is just for communication. It does not need to be a Window that is actually displayed. It just needs a WndProc so you can get the events from the driver. A hidden window is fine.

christophe_95
Posts: 5
Joined: Mon Feb 18, 2019 2:00 am

Re: Using SpaceNavigator without window handle

Post by christophe_95 » Mon Feb 18, 2019 7:34 am

Hello

I tried but if my application console window does not have focus, i don't receive any event !

What solution do you suggest to receive events without having focus ?

Regards
Christophe

christophe_95
Posts: 5
Joined: Mon Feb 18, 2019 2:00 am

Re: Using SpaceNavigator without window handle

Post by christophe_95 » Tue Feb 19, 2019 3:00 am

Hello again

I posted a reply but it did not get through..

I tried your suggestion but i don't receive events when the console window does not have focus.
This is a problem for me since the console window remains iconified most of the time and we need to give focus to other application windows.

Would it be possible to use Joystick API (joyGetPos) instead ?

Regards
Christophe

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

Re: Using SpaceNavigator without window handle

Post by jwick » Tue Feb 19, 2019 3:59 am

There is an SiGrabDevice function in the API that allows your app to grab the driver's focus. The driver won't switch to any other apps while you have exclusive focus. Your app will get all the data. It isn't a very nice thing to do to other 3D mouse-supporting apps, if that is relevant for your situation.

There are other APIs you can use but things get quite complicated if your users can potentially buy different devices. It's not too bad if you support only one device. But that code will more than likely break if the users buy different devices. Our API insulates you from all that. If you can use, it I suggest it.

christophe_95
Posts: 5
Joined: Mon Feb 18, 2019 2:00 am

Re: Using SpaceNavigator without window handle

Post by christophe_95 » Wed Feb 20, 2019 1:57 am

Thanks for your suggestion.

For my own information, do you intend to develop an API based on polling instead of events ? I see in the documentation that polling is mentioned but not yet supported

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

Re: Using SpaceNavigator without window handle

Post by jwick » Wed Feb 20, 2019 2:58 am

The polling support was implemented for a game device we had a hundred years ago. It's rusted to dust.

We are sort of moving again in that direction but with a different API.

I am extending our APIs and samples. If you have a suggestion about your particular domain now's the time to chime in with some details.
There definitely are differences for different tasks. E.g., machine contol and 3D graphics are very different.

Post Reply