diff options
Diffstat (limited to 'src/gwin/gwin_widget.h')
-rw-r--r-- | src/gwin/gwin_widget.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/gwin/gwin_widget.h b/src/gwin/gwin_widget.h index 3aa1b9f1..5239b6b8 100644 --- a/src/gwin/gwin_widget.h +++ b/src/gwin/gwin_widget.h @@ -356,6 +356,36 @@ bool_t gwinAttachListener(GListener *pl); bool_t gwinAttachDial(GHandle gh, uint16_t role, uint16_t instance); #endif +#if (GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD) || defined(__DOXYGEN__) + /** + * @brief Set the keyboard focus to a specific window + * @return Returns TRUE if the focus could be set to that window + * + * @param[in] gh The window + * + * @note Passing NULL will remove the focus from any window. + * @note Only visible enabled widgets are capable of getting the focus. + * + * @api + */ + bool_t gwinSetFocus(GHandle gh); + + /** + * @brief Get the widget that is currently in focus + * + * @details The widget that is currently in focus is the widget that + * receives mouse and keyboard events. + * + * @return The handle of the widget that is currently in focus. May be NULL. + * + * @api + */ + GHandle gwinGetFocus(void); +#else + #define gwinGetFocus() (0) + #define gwinSetFocus(gh) (FALSE) +#endif + #ifdef __cplusplus } #endif |