Qt and 2 SpaceNavigators

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

Moderator: Moderators

Qt and 2 SpaceNavigators

Postby staub » Fri Nov 21, 2008 7:20 am

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
staub
 
Posts: 5
Joined: Fri Nov 21, 2008 7:11 am

Postby jwick » Fri Nov 21, 2008 7:43 pm

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.
jwick
Moderator
Moderator
 
Posts: 1769
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA

Postby staub » Tue Nov 25, 2008 4:44 am

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
staub
 
Posts: 5
Joined: Fri Nov 21, 2008 7:11 am

Postby jwick » Tue Nov 25, 2008 7:30 am

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.
jwick
Moderator
Moderator
 
Posts: 1769
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA

Postby staub » Wed Nov 26, 2008 5:52 am

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
staub
 
Posts: 5
Joined: Fri Nov 21, 2008 7:11 am

Postby jwick » Wed Nov 26, 2008 8:03 am

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
jwick
Moderator
Moderator
 
Posts: 1769
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA

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

Postby onlooker » Wed Feb 25, 2009 9:15 am

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?
onlooker
 
Posts: 6
Joined: Tue Feb 24, 2009 8:00 pm


Return to Developer's Forum for Windows

Who is online

Users browsing this forum: No registered users and 1 guest