Keshav
December 16, 2022, 6:27am
#1
What do you want to achieve?
I want a simple numeric button matrix like this in SLS.
What have you tried so far?
I have tried this. But need only few options like above.
I can also see USER modes of Keyboard. Can it help? If yes, how to use it.
Others
SquareLine Studio version:
8.3.3
Operating system:
Target hardware:
2 Likes
Hi,
Using a USER mode is a good idea. You can customize the keyboard layout from code (after calling ui_init()
).
See Keyboard (lv_keyboard) — LVGL documentation
1 Like
Keshav
December 20, 2022, 6:04am
#3
Hello,
Its working fine now. I used this
/*Create a keyboard map*/
static const char * kb_map[] = {"1", "2", "3", "\n", "4", "5", "6", "\n", "7", "8", "9", "\n", LV_SYMBOL_BACKSPACE, "0", LV_SYMBOL_OK, NULL };
/*Set the relative width of the buttons and other controls*/
static const lv_btnmatrix_ctrl_t kb_ctrl[] = {20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20};
lv_keyboard_set_map(ui_keyboard, LV_KEYBOARD_MODE_USER_1, kb_map, kb_ctrl);
Well it would be good if this functionality can be added in SLS too.
1 Like
Keshav
December 30, 2022, 5:12am
#4
Hello @kisvegabor ,
There is a bug with the keyboard touch. The keyboard can take unwanted inputs if the any of the button is just touched. Rather it should only take the input after the touch is released. See the video here
Reagrds,
Keshav Aggarwal
You can control it with LV_BTNMATRIX_CTRL_CLICK_TRIG control flag.