From 0388755df1e3d65aa6d17f90965bcf5037c204ab Mon Sep 17 00:00:00 2001 From: inmarket Date: Sat, 26 Aug 2017 11:15:56 +1000 Subject: Add gwinTextEditSendKey() and gwinTextEditSendSpecialKey() --- src/gwin/gwin_textedit.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/gwin/gwin_textedit.h') diff --git a/src/gwin/gwin_textedit.h b/src/gwin/gwin_textedit.h index ed2f634d..8cf6c03e 100644 --- a/src/gwin/gwin_textedit.h +++ b/src/gwin/gwin_textedit.h @@ -63,6 +63,32 @@ extern "C" { GHandle gwinGTexteditCreate(GDisplay* g, GTexteditObject* wt, GWidgetInit* pInit, size_t maxSize); #define gwinTexteditCreate(wt, pInit, maxSize) gwinGTexteditCreate(GDISP, wt, pInit, maxSize) +/** + * @brief Send a special key to the textedit such as GKEY_LEFT, GKEY_RIGHT, GKEY_HOME, GKEY_END + * + * @param[in] gh The window handle (must be a textedit window) + * @param[in] key The special key to send. + * @pre Requires GINPUT_NEED_KEYBOARD or GWIN_NEED_KEYBOARD to be on + * @api + */ +void gwinTextEditSendSpecialKey(GHandle gh, uint8_t key); + +/** + * @brief Send a normal utf8 character to the textedit + * + * @param[in] gh The window handle (must be a textedit window) + * @param[in] pkey The pointer to the utf8 character to send. + * @param[in] len The length of the utf8 character in bytes. + * @note This must ONLY be called with a single utf8 character at a time. Don't attempt to + * send a string of characters in the one call. + * @note Characters are interpreted as if they came directly from a keyboard ie a backspace + * character will perform the backspace operation, a tab will send the focus to the next + * control etc. + * @pre Requires GINPUT_NEED_KEYBOARD or GWIN_NEED_KEYBOARD to be on + * @api + */ +void gwinTextEditSendKey(GHandle gh, char *pkey, unsigned len); + /** * @defgroup Renderings_Textedit Renderings * -- cgit v1.2.3