From 29bfe60438a46342bcd99a7ff57939a7a508ed03 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 1 Jun 2021 19:43:54 +0200 Subject: [PATCH] fix(docs) add docs about the default group --- docs/overview/indev.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/overview/indev.md b/docs/overview/indev.md index cb6b99ce1..0f5e899e1 100644 --- a/docs/overview/indev.md +++ b/docs/overview/indev.md @@ -82,6 +82,12 @@ In *Edit* mode, `LV_KEY_NEXT/PREV` is usually used to edit the object. Depending on the object's type, a short or long press of `LV_KEY_ENTER` changes back to *Navigate* mode. Usually, an object which can not be pressed (like a [Slider](/widgets/core/slider)) leaves *Edit* mode on short click. But with objects where short click has meaning (e.g. [Button](/widgets/core/btn)), a long press is required. +#### Default group +Interactive widgets - such as buttons, checkboxes, sliders, etc - can be automatically added to a default group. +Just create a group with `lv_group_t * g = lv_group_create();` and set the default group with `lv_group_set_default(g);` + +Don't forget to assign the input device(s) to the default group with ` lv_indev_set_group(my_indev, g);`. + ### Styling If an object is focused either by clicking it via touchpad, or focused via an encoder or keypad it goes to `LV_STATE_FOCUSED`. Hence focused styles will be applied on it.