Hi I am trying to capture a joystic button press events from low level driver code which calls into a C function that I imported into the Qt project along with my main app. The callback is defined as this:
joystick.c file:
#ifdef __cplusplus
extern "C"
{
#endif
int EventHandler_InputDeviceCallback( Handle t, char* pCommandData, void *pContext )
{
//identify event from joystic and trigger an event
}
: :: ::
#ifdef __cplusplus
}
#endif
All I want to do is call a member in MainWindow class which is also part of the project. How do I do it easily? I tried to pass MainWindow::this as the context during call back setup, and tried to typecst it witth Reinterpret_Cast and tried o call a method but it crashes.
There doesnt seem to be any connection whatsoever between the two, Can I use a global variable?
Bookmarks