aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/gwin_widget.h
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2015-08-16 21:53:47 +1000
committerinmarket <andrewh@inmarket.com.au>2015-08-16 21:53:47 +1000
commit15e7342fd7b21b76a565561a3caafee394e70c88 (patch)
treeaeb6898cfdbcb875f4b109d202f2b4560df42021 /src/gwin/gwin_widget.h
parent377fe644d1233e955dfd05e40fa9d335447de325 (diff)
downloaduGFX-15e7342fd7b21b76a565561a3caafee394e70c88.tar.gz
uGFX-15e7342fd7b21b76a565561a3caafee394e70c88.tar.bz2
uGFX-15e7342fd7b21b76a565561a3caafee394e70c88.zip
Updates to focus.
Diffstat (limited to 'src/gwin/gwin_widget.h')
-rw-r--r--src/gwin/gwin_widget.h30
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