Qt and 2 SpaceNavigators

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

Moderator: Moderators

Post Reply
staub
Posts: 5
Joined: Fri Nov 21, 2008 7:11 am

Qt and 2 SpaceNavigators

Post by staub »

We would like to use 2 SpaceNavigator devices within a Qt-based framework. Which would be the best method to access the devices? It seems like only the RAW_INPUT or DirectInput are a possibility for dual configurations. RAW_INPUT is not straight forward, since Qt cannot read window messages.

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

Post by jwick »

I did a quick google on qt windows messages and got a few hits. It seems it is possible to access the windows messages. Still, I'm sure it is a pain in the neck.

You can also use HID to access more than one device simultaneously. This doesn't require access to a window.
staub
Posts: 5
Joined: Fri Nov 21, 2008 7:11 am

Post by staub »

You are right, it is possible to catch the Window messages with Qt. The .txt file of the HID examples says "It currently will only list axis and button data from one of the devices it finds because aitForMultipleObjects only wakes on events from one". Is that still correct? If yes, how can I use 2 devices simultaniously?

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

Post by jwick »

I think that's still a problem on a single thread. You need one thread per device (each with its own wait). But if you break in to the windows event loop, it is much easier to use RawInput.
staub
Posts: 5
Joined: Fri Nov 21, 2008 7:11 am

Post by staub »

ok, thanks for the reply. Windows Messages work fine. Just two more questions:
- Is it possible to control the LED's?
- Are there plans for a driver which supports multiple devices? When will it be available?

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

Post by jwick »

Hi Chris,

To control the SN LEDs you can use the HIDRezero example from the ftp site but send a packet type 4 instead of 7. Data byte 1 turns the LEDs on. 0 turns them off.

You can mix this HID code in with your RawInput code because it is output only. Just call it as a standalone subroutine.

Yes, there will be a driver that will coordinate multiple devices. No, I can not give you a schedule.

Jim
3Dx Software Development
onlooker
Posts: 6
Joined: Tue Feb 24, 2009 8:00 pm

I want a dual device multi-threaded driver now (also PS3)

Post by onlooker »

I want a dual device multi-threaded driver now (also for the PS3).

Wouldn't it be nice to have game controller-like, dual device-in-one?
Post Reply