XPLMRegisterCommandHandler
From X-Plane SDK
XPLMRegisterCommandHandler
XPLM_API void XPLMRegisterCommandHandler( XPLMCommandRef inComand, XPLMCommandCallback_f inHandler, int inBefore, void * inRefcon);
XPLMRegisterCommandHandler registers a callback to be called when a command is executed. You provide a callback with a reference pointer.
If inBefore is true, your command handler callback will be executed before X-Plane executes the command, and returning 0 from your callback will disable X-Plane's processing of the command. If inBefore is false, your callback will run after X-Plane. (You can register a single callback both before and after a command.)