Keyboard Management


XPSetKeyboardFocus

function

Controls which widget will receive keystrokes. Pass the widget ID of the widget to get the keys. Note that if the widget does not care about keystrokes, they will go to the parent widget, and if no widget cares about them, they go to X-Plane.

If you set the keyboard focus to widget ID 0, X-Plane gets keyboard focus.

This routine returns the widget ID that ended up with keyboard focus, or 0 for X-Plane.

Keyboard focus is not changed if the new widget will not accept it. For setting to X-Plane, keyboard focus is always accepted.

XPLM_API XPWidgetID XPSetKeyboardFocus(
                         XPWidgetID           inWidget
                    );

XPLoseKeyboardFocus

function

This causes the specified widget to lose focus; focus is passed to its parent, or the next parent that will accept it. This routine does nothing if this widget does not have focus.

XPLM_API void       XPLoseKeyboardFocus(
                         XPWidgetID           inWidget
                    );

XPGetWidgetWithFocus

function

This routine returns the widget that has keyboard focus, or 0 if X-Plane has keyboard focus or some other plugin window that does not have widgets has focus.

XPLM_API XPWidgetID XPGetWidgetWithFocus(void);