SDK for the SpacePilot

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

Moderator: Moderators

Post Reply
Camael
Posts: 9
Joined: Fri Jan 04, 2008 6:12 pm

SDK for the SpacePilot

Post by Camael » Fri Jan 04, 2008 6:20 pm

Hello,

I'm using a SpacePilot and try to write some small demos for it. What I've recognized is that many features are not covered in the API (such as sending a custum configuration and stuff). Also it seems that button handling works different for the space pilot. Normally in the magellan-driver lib a ButtonPressEvent-Atom is send/received (according to the API), but here nothing happens when I press a button. Instead I have to listen for Events from type KeyPress/KeyRelease which then contain the key information... This wouldn't be too bad if it also worked for the "Sensitivity-/+-Buttons".
Is there any recent SDK which covers the features of the space pilot?
If not - does someone know what I did wrong with the button stuff and how I can get to the state of the +/--Buttons?

Thanks in Advance,
Joachim

UtaSH
Moderator
Moderator
Posts: 2965
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Re: SDK for the SpacePilot

Post by UtaSH » Mon Jan 07, 2008 9:23 am

Hi Joachim,

you should get the ButtonPress/ReleaseEvent Atoms if there is no mapping on the buttons. This is the case if you set the mapping of a button to "Button x" where x is the number of the button.

But the buttons +, -, Dom, Config and 3DLock are not re-programmable. For those the mapping is fix. Try it with any of the programmable buttons to see if you get the Atoms correctly. Would be nice if you post your results here. :)

Uta Ludwig
3Dconnexion

Camael
Posts: 9
Joined: Fri Jan 04, 2008 6:12 pm

Post by Camael » Tue Jan 08, 2008 1:09 pm

Hello,

Thanks for the reply. The buttons were on "Custom 1" - "Custom 6" when I tested it. Now with "Button 1" - "Button 6" things are working.

Currently I'm trying to make the thing window independent, so the window that is passed to the driver to receive the events is an invisible InputOnly-window. Does this have any sideeffect? What I realized at the moment is a problem using more than one window that requires the device. An invisible window doesn't have a way of reporting a focus lost/grab. So is there any other way to read the currently served window from the spacepilot driver or something like that?

Regards,
Joachim
Last edited by Camael on Tue Jan 08, 2008 1:57 pm, edited 3 times in total.

Camael
Posts: 9
Joined: Fri Jan 04, 2008 6:12 pm

Post by Camael » Tue Jan 08, 2008 1:12 pm

... just realized: When the event is a KeyPress event it should better not be casted as a XClientMessage-Event (as I did), so this error is gone.

Basically this explains everything - thanks for the help.

btw: the other questions about a way to access the newer features of the device remain :).

UtaSH
Moderator
Moderator
Posts: 2965
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Post by UtaSH » Wed Jan 09, 2008 6:38 am

Hello Joachim,
Camael wrote:Currently I'm trying to make the thing window independent, so the window that is passed to the driver to receive the events is an invisible InputOnly-window. Does this have any sideeffect?

There could be a focus problem if you use an invisible window (see here) We are working on this.
Camael wrote:What I realized at the moment is a problem using more than one window that requires the device. An invisible window doesn't have a way of reporting a focus lost/grab.
To load the appropriate configuration the driver reads the name of the window (class name, resource name or window name) which has the input focus. In your own configuration file you can put more than one window name that is used to identifiy the application.
  • APP_WINDOW_NAME = { "WinName1", "WinName2" }
But it will be always just one window that receives the messages from the driver. If you want the messages being received by another window you have to pass them over yourself.
Camael wrote:So is there any other way to read the currently served window from the spacepilot driver or something like that?

No, you can not get this information from the driver. If you set the event window with MagellanSetWindow() you can use this information. But as I mentioned before: there is an issue with this and you should just be patient until we have further information. Just check the above mentioned post.

Uta
3Dconnexion

Camael
Posts: 9
Joined: Fri Jan 04, 2008 6:12 pm

Post by Camael » Wed Jan 09, 2008 11:12 am

Thanks for the help :)

Regards,
Joachim

Post Reply