I'm using the below to init the SpaceNavigator.
When a button is hit, I recieve notification that either button 1 or 2 is hit.
If I go to the preferences panel and change Button 1 to Fit, how do I tell that Fit is now associated with Button 1?
If our PC implementation Fit returns back a button id of 31 which we can then perform the appropriate action.
Thanks
Tim
OSErr err = InstallConnexionHandlers(MyMessageHandler, 0L, 0L);
clientID = (long)RegisterConnexionClient('CS31', (UInt8 *)"\pViaCAD 3D", kConnexionClientModeTakeOver, mask);
Fit Button
Moderator: Moderators
On OS X, the "Fit" command is an application specific command instead of a physical or virtual button press. There is a specific event from the driver called kConnexionCmdAppSpecific for this. In your MyMessageHandler callback, you can add a case statement for processing these events. For example:
Code: Select all
case kConnexionCmdHandleAxis:
// do motion processing
break;
case kConnexionCmdAppSpecific:
if (msg->value == 31)
// handle Fit command
MyFitRoutine();
break;
Button commands that have to do with filtering motion data (Pan/Zoom Only, Tilt/Spin/Roll Only, Pan Only, Zoom Only, Toggle Translations, Toggle Rotations, Toggle Dominant Axis) or changing device settings (Increase Speed, Decrease Speed, Calibrate) are handled by the driver. There's no need to process these within your application.
A note on Pan/Zoom Only, Tilt/Spin/Roll Only, Pan Only, and Zoom Only. These commands are only active while the button is being pressed. Once you release the button, the previous state of events being sent by the driver resumes. Only the Toggle XX commands actually change the filtering of data even after the button is released
A note on Pan/Zoom Only, Tilt/Spin/Roll Only, Pan Only, and Zoom Only. These commands are only active while the button is being pressed. Once you release the button, the previous state of events being sent by the driver resumes. Only the Toggle XX commands actually change the filtering of data even after the button is released