register_key_event_handler_EX1

The register_key_event_handler function registers a key event callback function.

IMPORTANT! This function replaces the deprecated register_key_event_handler function.

 

Syntax
void register_key_event_handler_EX1(
    GAUGE_KEY_EVENT_HANDLER_EX1  handler,
    PVOID  userdata
    );

 

Members
Parameters Description
handler

Specifies the handler function, which should match the following definition:

typedef void (*GAUGE_KEY_EVENT_HANDLER_EX1) (ID32 event, UINT32 evdata, PVOID userdata);

userdata Specifies an optional value for use by the gauge developer. This value will be returned to the key event handler function, whenever it is called.

Return Values

This function does not return a value.

 

Example

This example shows how to receive custom numeric events from part animations.

 

Defined in gauges.h:

const int EVENT_BUTTON_PUSH = 0x11000; 

Code in the gauge handler:

bool g_ButtonState = false;
void EventHandler(ID32 event, UINT32 evdata0, UINT32 evdata1, UINT32 evdata2, UINT32 evdata3, UINT32 evdata4, PVOID userdata)
    {
        switch(event)
        {
            case EVENT_BUTTON_PUSH:
                g_ButtonState = !g_ButtonState;
                break;
            default:
                break;
        }
    }
void FSAPI module_init(void)
    {
        if (NULL != Panels)
            {
                ImportTable.PANELSentry.fnptr = (PPANELS)Panels;
                PanelCallbackInit();
            }
        register_key_event_handler_EX1((GAUGE_KEY_EVENT_HANDLER_EX1)EventHandler, NULL);
    }  

 

Remarks

N/A

 

See Also