Problems getting ButtonPressEvent and ButtonReleaseEvent

Questions and answers about 3Dconnexion devices on UNIX and Linux.

Moderator: Moderators

Post Reply
marcus
Posts: 11
Joined: Mon Apr 28, 2008 4:47 am
Location: Malmö, Sweden

Problems getting ButtonPressEvent and ButtonReleaseEvent

Post by marcus »

I have run into problems using my SpacePilot. It seems that neither xapp (from the SDK) or the app I am woking on are registrering the button events from my SpacePilot. They *do* work in blender though. On top of this both the xapp (from the SDK) and my own code are registrering motion data. Why is this?
marcus
Posts: 11
Joined: Mon Apr 28, 2008 4:47 am
Location: Malmö, Sweden

Post by marcus »

Extra information: 3DxwareUNIX = V1.2.27, ID 3734 (some beta driver of some sort I believe it is too).

XInternAtom gives me MotionEvent = 378, ButtonPressEvent=379 and ButtonReleaseEvent=380. This is the very same as the xapp is reporting so atleast the interning is working. It does however seem to me that there is no event even being sent to the window on buttonpress and buttonrelease.
marcus
Posts: 11
Joined: Mon Apr 28, 2008 4:47 am
Location: Malmö, Sweden

Post by marcus »

Ok. I have finally gotten *something* to detect my pressing of the keys on the 3d spacepilot. Xev reports the buttons as keypress events and keypress releases. Not as client messages as per the API. What am I doing wrong here?
crobl
Moderator
Moderator
Posts: 138
Joined: Mon Feb 26, 2007 8:34 am
Location: Freiham, Germany

Post by crobl »

Hi marcus,

if the demo xapp doesn't work, then something might be really screwed up - it has to work! At least this example!

Ok, lets try something:
1. Start the driver(if its not running), open the GUI and set the configuration ("3DxWare for") to "Driver Protocol 1.0".
2. Leave the GUI open, open a terminal window and start the "xapp" demo.

Does the configuration change to "Any Application"? (If you don't already have custom configuration(s) for xapp, it should!)

If the configuration is not "Any Application", is it "Driver Protocol 1.0" or something else (probably a custom configuration)?
Change the configuration to "Any Application". Does "xapp" work now?

Please stop the driver and remove the file $HOME/.3dxrc and the directory $HOME/.3dxcfg (please make sure, that you backup already created custom configurations prior doing this). Now restart the driver, then start xapp again. Does it work?

Please let me know what your results are!


Regards,

Christian
3Dconnexion
marcus
Posts: 11
Joined: Mon Apr 28, 2008 4:47 am
Location: Malmö, Sweden

Post by marcus »

When I fire up xapp then the 3dxware window says "Any Application", and xapp prints the motion information. It does not, however, print the button press and release information.

So basically the case MagellanInputButtonPressEvent is never switched to. My testing around with various things have given me the distinct impression that pressing the buttons on the mouse does not make 3dxware send a clientmessage to xapp (or any other app for that matter).
crobl
Moderator
Moderator
Posts: 138
Joined: Mon Feb 26, 2007 8:34 am
Location: Freiham, Germany

Post by crobl »

Hi marcus,

I think I know whats "wrong"... :roll:
The button mapping in "Any Application" doesn't contain a mapping that by default sends out a button number, we have mapped some macros to the buttons (as an example for a more complex user defined mapping). If you go to the driver window and have a look at the tabs General or Button Mapping, you will see something like "Custom 1" mapped to most of the buttons. You'll have to change it to "Button 1" or so. Then it will work!

You can also have a look at this thread covering quite the same. :shock:

Please let me know if this is the solution for your problem!

Regards,
Christian
3Dconnexion
marcus
Posts: 11
Joined: Mon Apr 28, 2008 4:47 am
Location: Malmö, Sweden

Post by marcus »

Works like a charm! Thank you very much, Christian. Again excellent service from 3dconnexion! and I can go back to hacking in support for the spacepilot into sxemacs 8)
Post Reply