I am currently adding support for 3dconnexion devices in my application. Yesterday I was able to move and rotate a triangle in a sample application. I am unable to get the buttons to work. Here is what I tried so far:
I am using Qt for my application so I created a small demo application. I open and register in the constructor of my OpenGLWidget:
Code: Select all
SpwRetVal retVal;
retVal = SiInitialize();
if (retVal == SPW_ERROR ) {
qWarning() << "Error in SiInitialize()";
}
SiOpenData oData;
SiOpenWinInit( &oData, (HWND)winId() );
m_hdl = SiOpen ("PAC", SI_ANY_DEVICE, SI_NO_MASK,
SI_EVENT, &oData);
if (m_hdl == SI_NO_HANDLE) {
qWarning() << "Could not open a 3DxWare device";
}
Code: Select all
bool GLWidget::nativeEvent(const QByteArray &eventType, void *message, long *result)
{
if(eventType == "windows_generic_MSG") {
const MSG *msg = reinterpret_cast<MSG *>(message);
SiGetEventData eData; /* Platform-specific event data */
SiSpwEvent siEvent; /* 3DxWare data event */
SiGetEventWinInit (&eData, msg->message, msg->wParam,
msg->lParam);
if (SiGetEvent (m_hdl, 0, &eData, &siEvent) == SI_IS_EVENT) {
switch (siEvent.type) {
case SI_MOTION_EVENT: {
// Handling of motion events. This gets called and works
} break;
case SI_ZERO_EVENT:
break;
case SI_APP_EVENT:
qDebug() << "App event"; // Neither does this one gets called
break;
case SI_CMD_EVENT:
qDebug() << "CMD event"; // Nor does this one gets called
break;
case SI_DEVICE_CHANGE_EVENT:
break;
default:
break;
} /* end switch on 3DxWare event type*/
}
}
return QOpenGLWidget::nativeEvent(eventType, message, result);
}
viewtopic.php?f=19&t=11485
The driver automatically generated a config file for me. I manually added the XML-part at the end of the file, however the buttons still do not issue any events. I would like to attach my config file, however neither xml nor txt is accepted as file extions.
I am using 3Dware V 10.5.4.
Best regards
Axel