- Messages
- 1
- Country

Hi, I can't get custom events from 3d cockpit to my c++ code.
I do the following steps:
1) In the modeldef.xml set <EventID>0x11001</EventID> for corresponding element.
2) in c code:
void FSAPI module_init(void)
{
register_key_event_handler((GAUGE_KEY_EVENT_HANDLER)ClockButtonsHandler, NULL);
}
void FSAPI ClockButtonsHandler(ID32 event, UINT32 evdata, PVOID userdata)
{
// some code
}
And nothing happen, but when I set standard event id e.g. TOGGLE_ELECT_FUEL_PUMP1, ClockButtonsHandler is called with proper event parameter.
In sdk example for custom event there are strange lines (marked with *):
void FSAPI module_init(void)
{
* if (NULL != Panels)
* {
* ImportTable.PANELSentry.fnptr = (PPANELS)Panels;
* PanelCallbackInit();
* }
register_key_event_handler((GAUGE_KEY_EVENT_HANDLER)EventHandler, NULL);
}
As I could understand it's some initialization of panel callback, but I don't know how to do it in my code and how to create variable Panels.
I do the following steps:
1) In the modeldef.xml set <EventID>0x11001</EventID> for corresponding element.
2) in c code:
void FSAPI module_init(void)
{
register_key_event_handler((GAUGE_KEY_EVENT_HANDLER)ClockButtonsHandler, NULL);
}
void FSAPI ClockButtonsHandler(ID32 event, UINT32 evdata, PVOID userdata)
{
// some code
}
And nothing happen, but when I set standard event id e.g. TOGGLE_ELECT_FUEL_PUMP1, ClockButtonsHandler is called with proper event parameter.
In sdk example for custom event there are strange lines (marked with *):
void FSAPI module_init(void)
{
* if (NULL != Panels)
* {
* ImportTable.PANELSentry.fnptr = (PPANELS)Panels;
* PanelCallbackInit();
* }
register_key_event_handler((GAUGE_KEY_EVENT_HANDLER)EventHandler, NULL);
}
As I could understand it's some initialization of panel callback, but I don't know how to do it in my code and how to create variable Panels.