XPLMHasKeyboardFocus
XPLM_API int XPLMHasKeyboardFocus(
XPLMWindowID inWindow);
Returns true (1) if the indicated window has keyboard focus. Pass a window ID of 0 to see if no plugin window has focus, and all keystrokes will go directly to X-Plane.