From d9f80ecf1a967c3670abc18c1551932712f427c3 Mon Sep 17 00:00:00 2001 From: xennex22 Date: Sat, 28 Sep 2019 09:15:22 -0700 Subject: [PATCH] Update lv_kb.h Changed keyboard map set functions to take 'lv_kb_shift_t' keyboard shift parameter --- src/lv_objx/lv_kb.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/lv_objx/lv_kb.h b/src/lv_objx/lv_kb.h index f08891f1b..16e385f61 100644 --- a/src/lv_objx/lv_kb.h +++ b/src/lv_objx/lv_kb.h @@ -68,6 +68,14 @@ enum { }; typedef uint8_t lv_kb_style_t; + +enum { + LC_KB_SHIFT_LOWER = 0, + LC_KB_SHIFT_UPPER, + LC_KB_SHIFT_SYMBOL, +}; +typedef uint8_t lv_kb_shift_t; + /********************** * GLOBAL PROTOTYPES **********************/ @@ -108,26 +116,22 @@ void lv_kb_set_cursor_manage(lv_obj_t * kb, bool en); /** * Set a new map for the keyboard * @param kb pointer to a Keyboard object + * @param shift keyboard map to alter 'lv_kb_shift_t' * @param map pointer to a string array to describe the map. * See 'lv_btnm_set_map()' for more info. */ -static inline void lv_kb_set_map(lv_obj_t * kb, const char * map[]) -{ - lv_btnm_set_map(kb, map); -} +void lv_kb_set_map(lv_obj_t * kb, lv_kb_shift_t shift, const char * map[]); /** * Set the button control map (hidden, disabled etc.) for the keyboard. The * control map array will be copied and so may be deallocated after this * function returns. * @param kb pointer to a keyboard object + * @param shift keyboard ctrl map to alter 'lv_kb_shift_t' * @param ctrl_map pointer to an array of `lv_btn_ctrl_t` control bytes. * See: `lv_btnm_set_ctrl_map` for more details. */ -static inline void lv_kb_set_ctrl_map(lv_obj_t * kb, const lv_btnm_ctrl_t ctrl_map[]) -{ - lv_btnm_set_ctrl_map(kb, ctrl_map); -} +void lv_kb_set_ctrl_map(lv_obj_t * kb, lv_kb_shift_t shift, const lv_btnm_ctrl_t ctrl_map[]); /** * Set a style of a keyboard