Event Broadcasting in the 3DxValuesCarbon example code
Moderator: Moderators
Event Broadcasting in the 3DxValuesCarbon example code
I am implementing the sample code from the 3DxValuesCarbon example in a Qt application I'm compiling with qmake, and the spacenavigator only seems to broadcast an event when I click the buttons, but not when I move the knob around.
I display a mesasge box in the top of the tdx_drv_handler function which should receive all the events from the SpaceNavigator, but it only shows the message when I click one of the buttons on the device. Am I missing something?
It also doesn't seem to be recognizing the messageType properly in the switch(messageType) statement. It's jumping straight to the default case no matter what cases I put in there.
I hope this makes sense, thanks for the help.
dave
I display a mesasge box in the top of the tdx_drv_handler function which should receive all the events from the SpaceNavigator, but it only shows the message when I click one of the buttons on the device. Am I missing something?
It also doesn't seem to be recognizing the messageType properly in the switch(messageType) statement. It's jumping straight to the default case no matter what cases I put in there.
I hope this makes sense, thanks for the help.
dave
A couple of things to check.
- Be sure to get the latest driver v1.0.2. This has the latest data structure definitions.
- When you're calling RegisterConnexionClient, pass kConnexionClientModeTakeOver as the mode and try kConnexionMaskAxis | kConnexionMaskButtons as the mask. kConnexionMaskAll should also work.
- Be sure to get the latest driver v1.0.2. This has the latest data structure definitions.
- When you're calling RegisterConnexionClient, pass kConnexionClientModeTakeOver as the mode and try kConnexionMaskAxis | kConnexionMaskButtons as the mask. kConnexionMaskAll should also work.
Other things to check or try:
- In RegisterConnexionClient, pass a unique 32bit signature for your app
- Create a setting for your application in the 3Dconnexion preference pane. You can do this by selecting "Add Applicaton..." on the popup menu and selecting the app you're developing
- Try changing the mask to kConnexionMaskAxis | kConnexionMaskButtons.
- In RegisterConnexionClient, pass a unique 32bit signature for your app
- Create a setting for your application in the 3Dconnexion preference pane. You can do this by selecting "Add Applicaton..." on the popup menu and selecting the app you're developing
- Try changing the mask to kConnexionMaskAxis | kConnexionMaskButtons.
I had been passing this as my unique id for my app:
'topmod'
and i just tried this and nothing changed:
(UInt32)('TopMod2007')
and it did not work either. I have tried the other mask setting, and I added the application to the preference pane before I had started any of this code writing process.
Another thing I just noticed is that the buttons only seem to call the callback function when they are set to the "open preference pane" action. Otherwise the button clicks don't call the callback function.
Also, when I am in another program, but have my app open in the background, the right button will call the callback function but the left one will only call it when the app has focus. None of this is adding up, and I really sorry to keep bothering you.
Is there anything else to try?
'topmod'
and i just tried this and nothing changed:
(UInt32)('TopMod2007')
and it did not work either. I have tried the other mask setting, and I added the application to the preference pane before I had started any of this code writing process.
Another thing I just noticed is that the buttons only seem to call the callback function when they are set to the "open preference pane" action. Otherwise the button clicks don't call the callback function.
Also, when I am in another program, but have my app open in the background, the right button will call the callback function but the left one will only call it when the app has focus. None of this is adding up, and I really sorry to keep bothering you.
Is there anything else to try?
I can find virtually no documentation about how to use CFBundleSignature, let alone how to use it with Qt.
The 3dxMacWare SDK pdf file simply says:
I also tried not setting the CFBundleSignature, and setting the name to '\pTopMod', but it will not accept that as a UInt* value. Then I tried typecasting it but then it gets an error when I compile it.
The documentation seems a bit incomplete to me, but maybe I'm just not experienced enough with Mac development. It seems like it should be way easier than this, and I have nowhere else to go for help,
Dave
The 3dxMacWare SDK pdf file simply says:
and for name it saysCFBundleSignature:
Your application’s creator signature. This is the 32-bit CFBundleSignature value.
You can pass zero (0) if your application does not have one. If you pass 0, you
must provide a valid name parameter. The driver uses this value to identify if
your application is the active (front-most) application.
So I attempted to manually edit my info.plist file inside the app bundle after compiling to set CFBundleSignature to 'TopM', and send NULL for the name. That didn't work.This is your application’s executable name formatted as a Pascal string (e.g.
“\pMyApplication”). Note that this string is the actual executable and not the
application bundle name. You may pass NULL but if you do, the signature
parameter must be a valid CFBundleSignature value.
I also tried not setting the CFBundleSignature, and setting the name to '\pTopMod', but it will not accept that as a UInt* value. Then I tried typecasting it but then it gets an error when I compile it.
The documentation seems a bit incomplete to me, but maybe I'm just not experienced enough with Mac development. It seems like it should be way easier than this, and I have nowhere else to go for help,
Dave
Hi Dave,dvmorris wrote:I had been passing this as my unique id for my app:
'topmod'
and i just tried this and nothing changed:
(UInt32)('TopMod2007')
you can't have an ID longer than 4 chars since in total it's a 32bit unsigned int. So as you said, let's use 'TopM'. Now, please verify this:
- in your Info.plist file: the CFBundleSignature entry should be:
Code: Select all
<key>CFBundleSignature</key>
<string>TopM</string>
Code: Select all
TdxInitDevice('TopM', TRUE, kConnexionClientModeTakeOver, kConnexionMaskAll);
Code: Select all
yourClientID = RegisterConnexionClient('TopM', "\pYourAppName", kConnexionClientModeTakeOver, kConnexionMaskAll);
Hope this helps.
ettore pasquini
software engineer
3Dconnexion, inc.
software engineer
3Dconnexion, inc.
I am doing everything right as far as I can tell. This is the output from the callback function when I click one of the buttons, but turning the knob or tilting or twisting it doesn't call the callback function still.
The documentation is absolutely not clear enough to make this thing work. Has anyone ever actually gotten it to work with their own app before?
The documentation is absolutely not clear enough to make this thing work. Has anyone ever actually gotten it to work with their own app before?
Code: Select all
front app client: 0 ourID: 8206
command: 255
value: 0
param: 0
report[0]: 0
report[1]: 0
report[2]: 0
report[3]: 0
report[4]: 0
report[5]: 0
report[6]: 0
report[7]: 0
buttons: 0
TX: 0
TY: 0
TZ: 0
RX: 0
RY: 0
RZ: 0
-----------------------------------------